3D curves & sketch Use
A 3D curve (Path3D) is a Sweep / MultiSectionSweep path, a Loft guide
rail, or a FillSurface / BoundarySurface boundary. Besides Spline3D and
Helix3D, four curves are built from other geometry:
| Node | Curve |
|---|---|
CompositeCurve(curves) | several curves chained end to end into one path (any order or direction) |
IntersectionCurve(first, second) | where two bodies meet: solids or surfaces, in any mix |
IsoparametricCurve(surface, direction=U, at=0.5, face_finder=None) | a constant-U / constant-V line across a face of a sheet |
ProjectedCurve(curve, plane, direction=None) | a curve projected onto a plane, along its normal or along direction |
CompositeCurve: the pieces must touch end to end (within 0.001 mm); a gap is an error naming where the chain stops.IntersectionCurve: the result must be one connected curve (a closed loop or an open one). Two cylinders’ sketches extruded as surfaces (ExtrudedSurface) and intersected give Onshape’s “projected curve from two sketches”.IsoparametricCurve:atis the fraction of the face’s parameter range (0 = one edge, 1 = the opposite one). On a sheet with several faces (a full tube has two half-cylinders), pick one withface_finder.ProjectedCurveis exact: lines stay lines, a circle parallel to the plane stays a circle, a tilted circle becomes the ellipse it casts.
ring = Sweep(Circle(Sketch(self.xz()).origin, 1.5), IntersectionCurve(ball, tube))
rod = Sweep(Circle(Sketch(self.xz()).origin, 2), IsoparametricCurve(sheet, IsoDirection.V, 0.5))
shadow = ProjectedCurve(Helix3D(6, 6, 8, Point3D(0, 0, 3), Point3D(0, 0, 1)), self.xy())Not available: projecting a curve onto a curved face (the OpenCascade build in the kernel lacks the projection algorithm; only planes are supported), and offsetting a curve within a face.
Sketch “Use”: model edges in a sketch
ProjectedEdges(sketch, body, edge_finder=None) projects edges of a body
(solid or surface) into a sketch, along the sketch normal, as sketch geometry:
use it as an Extrusion / Lathe profile (closed) or a SurfaceLoft section
(open).
edge_finderpicks the edges; without it every edge is used. Edges that land on the same curve count once (a box’s top and bottom outlines), and edges seen end-on are dropped (its vertical edges).- The edges must chain into one outline or one open chain.
- Draw it on a sketch other than the body’s own (the lid above uses a sketch 14 mm up).
box = Extrusion(Rectangle.from_center_and_sides(Sketch(self.xy()).origin, 24, 14), 8)
lid = Extrusion(ProjectedEdges(Sketch(self.xy().get_parallel_plane(14)), box), 2)Sketch mirror is a sketch helper, mirror(shape, line): see
Sketch operations.