Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Parametric Fender-style solid mandolin body for the matching bolt-on neck.
- Units: millimeters.
- Coordinate system matches mandolin_fender_style_neck.py:
- - Nut is at X = 0
- - Neck centerline is Y = 0
- - Nominal high-course bridge/saddle line is at X = scale
- - Neck heel/pocket end is at X = nut_to_heel_end
- Default design intent:
- - 13.875 in / 352.425 mm scale
- - Body top at Z = 0, body extends downward to Z = -body_thickness
- - Recessed Fender-style neck pocket
- - 4 neck screw clearance holes through the body, aligned to the neck pilot holes
- - 2 bridge mounting holes near the scale line
- - 2 tailpiece mounting holes behind the bridge
- Run:
- python mandolin_fender_style_body.py
- Exports:
- mandolin_fender_style_body.step
- mandolin_fender_style_body.stl
- mandolin_body_and_neck_reference.step # if mandolin_fender_style_neck.py is importable
- CadQuery install example:
- conda install -c conda-forge cadquery
- """
- from __future__ import annotations
- from dataclasses import dataclass
- import cadquery as cq
- MM_PER_INCH = 25.4
- @dataclass(frozen=True)
- class BodyParams:
- # Match the neck script defaults
- scale: float = 13.875 * MM_PER_INCH # 352.425 mm
- nut_to_heel_end: float = 10.25 * MM_PER_INCH # 260.35 mm
- heel_length: float = 55.0
- heel_width: float = 39.0
- heel_pocket_clearance: float = 0.35
- # Body proportions: roughly mandolin-sized solidbody, not a full ES/archtop mandolin
- body_thickness: float = 34.0
- pocket_depth: float = 16.0
- body_start_extra: float = 18.0 # body extends this far forward of pocket start
- body_length: float = 285.0 # from body_start_x to strap-end/tail end
- upper_bout_width: float = 175.0
- waist_width: float = 150.0
- lower_bout_width: float = 255.0
- # Mounting holes
- neck_screw_clearance_dia: float = 4.2
- neck_screw_counterbore_dia: float = 9.0
- neck_screw_counterbore_depth: float = 4.0
- # Bridge / tailpiece mounting holes. These are just sensible pilots/clearance holes;
- # adjust to match your actual bridge and tailpiece hardware.
- bridge_hole_dia: float = 3.2
- bridge_post_spacing: float = 42.0
- bridge_x_offset_from_scale: float = 2.0 # slightly behind nominal scale line
- tailpiece_hole_dia: float = 4.0
- tailpiece_hole_spacing: float = 38.0
- tailpiece_x_offset_from_scale: float = 76.0
- # Optional wire/string-through reference holes, disabled by default
- stl_tolerance: float = 0.08
- stl_angular_tolerance: float = 0.2
- P = BodyParams()
- def make_body_blank(p: BodyParams) -> cq.Workplane:
- """Make a small offset-waist Fender-ish mandolin solidbody."""
- pocket_start_x = p.nut_to_heel_end - p.heel_length
- x0 = pocket_start_x - p.body_start_extra
- x1 = x0 + p.body_length
- # Key longitudinal stations
- xn = x0 + 8.0 # neck-side upper shoulder
- xu = x0 + 60.0 # upper bout
- xw = x0 + 132.0 # waist
- xl = x0 + 215.0 # lower bout
- xt = x1 - 6.0 # rounded tail
- # Outline points, clockwise, using splines for a smooth guitar/mandolin body.
- # Widths are total widths, so y uses half width.
- pts = [
- (xn, -p.heel_width * 0.78),
- (xu, -p.upper_bout_width * 0.50),
- (xw, -p.waist_width * 0.50),
- (xl, -p.lower_bout_width * 0.50),
- (xt, -p.lower_bout_width * 0.34),
- (x1, 0.0),
- (xt, p.lower_bout_width * 0.34),
- (xl, p.lower_bout_width * 0.50),
- (xw, p.waist_width * 0.50),
- (xu, p.upper_bout_width * 0.50),
- (xn, p.heel_width * 0.78),
- ]
- body = (
- cq.Workplane("XY")
- .moveTo(*pts[0])
- .spline(pts[1:])
- .close()
- .extrude(-p.body_thickness)
- )
- # Soften the front/back perimeter a bit. If your CadQuery install complains about
- # the selector, comment these two lines out; the flat functional features remain.
- body = body.edges("|Z").fillet(4.0)
- body = body.edges("<Z or >Z").fillet(1.5)
- return body
- def make_neck_pocket_cutter(p: BodyParams) -> cq.Workplane:
- pocket_start_x = p.nut_to_heel_end - p.heel_length
- width = p.heel_width + 2.0 * p.heel_pocket_clearance
- length = p.heel_length + 0.8
- # Cuts from body top Z=0 downward to pocket floor at -pocket_depth.
- return (
- cq.Workplane("XY")
- .box(length, width, p.pocket_depth + 0.2, centered=(False, True, False))
- .translate((pocket_start_x - 0.4, 0, -p.pocket_depth - 0.1))
- )
- def cut_neck_mounting_holes(body: cq.Workplane, p: BodyParams) -> cq.Workplane:
- pocket_start_x = p.nut_to_heel_end - p.heel_length
- screw_xs = [pocket_start_x + p.heel_length * 0.34, pocket_start_x + p.heel_length * 0.74]
- screw_ys = [-p.heel_width * 0.27, p.heel_width * 0.27]
- for x in screw_xs:
- for y in screw_ys:
- through = (
- cq.Workplane("XY")
- .center(x, y)
- .circle(p.neck_screw_clearance_dia / 2.0)
- .extrude(-p.body_thickness - 1.0)
- .translate((0, 0, 0.5))
- )
- body = body.cut(through)
- # Counterbore from the back face. Because the body extends negative Z,
- # this is placed at the bottom/back side.
- counterbore = (
- cq.Workplane("XY")
- .center(x, y)
- .circle(p.neck_screw_counterbore_dia / 2.0)
- .extrude(p.neck_screw_counterbore_depth)
- .translate((0, 0, -p.body_thickness - 0.05))
- )
- body = body.cut(counterbore)
- return body
- def cut_bridge_and_tailpiece_holes(body: cq.Workplane, p: BodyParams) -> cq.Workplane:
- bridge_x = p.scale + p.bridge_x_offset_from_scale
- tailpiece_x = p.scale + p.tailpiece_x_offset_from_scale
- for y in [-p.bridge_post_spacing / 2.0, p.bridge_post_spacing / 2.0]:
- hole = (
- cq.Workplane("XY")
- .center(bridge_x, y)
- .circle(p.bridge_hole_dia / 2.0)
- .extrude(-p.body_thickness - 1.0)
- .translate((0, 0, 0.5))
- )
- body = body.cut(hole)
- for y in [-p.tailpiece_hole_spacing / 2.0, p.tailpiece_hole_spacing / 2.0]:
- hole = (
- cq.Workplane("XY")
- .center(tailpiece_x, y)
- .circle(p.tailpiece_hole_dia / 2.0)
- .extrude(-p.body_thickness - 1.0)
- .translate((0, 0, 0.5))
- )
- body = body.cut(hole)
- return body
- def add_reference_marks(body: cq.Workplane, p: BodyParams) -> cq.Workplane:
- """Add shallow engraved centerline and scale-line marks for layout sanity checks."""
- pocket_start_x = p.nut_to_heel_end - p.heel_length
- x0 = pocket_start_x - p.body_start_extra + 10.0
- x1 = x0 + p.body_length - 20.0
- centerline = (
- cq.Workplane("XY")
- .box(x1 - x0, 0.7, 0.6, centered=(False, True, False))
- .translate((x0, 0, -0.35))
- )
- scale_mark = (
- cq.Workplane("XY")
- .box(1.0, 70.0, 0.6, centered=(True, True, False))
- .translate((p.scale, 0, -0.35))
- )
- pocket_end_mark = (
- cq.Workplane("XY")
- .box(1.0, 50.0, 0.6, centered=(True, True, False))
- .translate((p.nut_to_heel_end, 0, -0.35))
- )
- return body.cut(centerline).cut(scale_mark).cut(pocket_end_mark)
- def build_body(p: BodyParams = P, reference_marks: bool = True) -> cq.Workplane:
- body = make_body_blank(p)
- body = body.cut(make_neck_pocket_cutter(p))
- body = cut_neck_mounting_holes(body, p)
- body = cut_bridge_and_tailpiece_holes(body, p)
- if reference_marks:
- body = add_reference_marks(body, p)
- return body
- def try_build_body_and_neck_reference(body: cq.Workplane, p: BodyParams) -> cq.Workplane | None:
- """Optional assembly reference if the neck script is next to this file."""
- try:
- import mandolin_fender_style_neck as neck_script
- except Exception:
- return None
- neck = neck_script.build_model(neck_script.P)
- # Drop the heel bottom onto the pocket floor. The neck script's heel bottom is at Z=0.
- neck = neck.translate((0, 0, -p.pocket_depth))
- return body.union(neck)
- if __name__ == "__main__":
- body = build_body(P)
- cq.exporters.export(body, "mandolin_fender_style_body.step")
- cq.exporters.export(body, "mandolin_fender_style_body.stl", tolerance=P.stl_tolerance, angularTolerance=P.stl_angular_tolerance)
- ref = try_build_body_and_neck_reference(body, P)
- if ref is not None:
- cq.exporters.export(ref, "mandolin_body_and_neck_reference.step")
- print("Exported mandolin_body_and_neck_reference.step")
- bridge_x = P.scale + P.bridge_x_offset_from_scale
- tailpiece_x = P.scale + P.tailpiece_x_offset_from_scale
- print("Exported mandolin_fender_style_body.step")
- print("Exported mandolin_fender_style_body.stl")
- print(f"Body top: Z = 0; body back: Z = {-P.body_thickness:.3f} mm")
- print(f"Neck pocket floor: Z = {-P.pocket_depth:.3f} mm")
- print(f"Pocket start X: {P.nut_to_heel_end - P.heel_length:.3f} mm")
- print(f"Pocket end X: {P.nut_to_heel_end:.3f} mm")
- print(f"Nominal scale line X: {P.scale:.3f} mm")
- print(f"Bridge holes X: {bridge_x:.3f} mm, Y: +/-{P.bridge_post_spacing / 2.0:.3f} mm")
- print(f"Tailpiece holes X: {tailpiece_x:.3f} mm, Y: +/-{P.tailpiece_hole_spacing / 2.0:.3f} mm")
Advertisement
Comments
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=dgmqowwchk
- This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
- The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
- Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment