Skip to content

Commit 0a3af73

Browse files
benjamaan476jtran
andauthored
Conics (#900)
* sketch out ellipse endpoints * change center to 2d * added conic endpoint * don't need Ellipseto * Update modeling-cmds/src/shared.rs Co-authored-by: Jonathan Tran <jonnytran@gmail.com> --------- Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
1 parent f443c6b commit 0a3af73

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

modeling-cmds/src/shared.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,33 @@ pub enum PathSegment {
340340
///from the end of the involute, otherwise it will start from that start.
341341
reverse: bool,
342342
},
343+
///Adds an elliptical arc segment.
344+
Ellipse {
345+
/// The center point of the ellipse.
346+
center: Point2d<LengthUnit>,
347+
/// Major radius of the ellipse (along the x axis).
348+
major_radius: LengthUnit,
349+
/// Minor radius of the ellipse (along the y axis).
350+
minor_radius: LengthUnit,
351+
/// Start of the path along the perimeter of the ellipse.
352+
start_angle: Angle,
353+
/// End of the path along the perimeter of the ellipse.
354+
end_angle: Angle,
355+
},
356+
///Adds a generic conic section specified by the end point, interior point and tangents at the
357+
///start and end of the section.
358+
ConicTo {
359+
/// Interior point that lies on the conic.
360+
interior: Point2d<LengthUnit>,
361+
/// End point of the conic.
362+
end: Point2d<LengthUnit>,
363+
/// Tangent at the start of the conic.
364+
start_tangent: Point2d<LengthUnit>,
365+
/// Tangent at the end of the conic.
366+
end_tangent: Point2d<LengthUnit>,
367+
/// Whether or not the interior and end points are relative to the previous path position.
368+
relative: bool,
369+
},
343370
}
344371

345372
/// An angle, with a specific unit.

0 commit comments

Comments
 (0)