@@ -31,7 +31,7 @@ define_modeling_cmd_enum! {
3131 ExtrudedFaceInfo , ExtrudeMethod ,
3232 AnnotationOptions , AnnotationType , CameraDragInteractionType , Color , DistanceType , EntityType ,
3333 PathComponentConstraintBound , PathComponentConstraintType , PathSegment , PerspectiveCameraParameters ,
34- Point2d , Point3d , SceneSelectionType , SceneToolType , Opposite ,
34+ Point2d , Point3d , ExtrudeReference , SceneSelectionType , SceneToolType , Opposite ,
3535 } ,
3636 units,
3737 } ;
@@ -100,9 +100,11 @@ define_modeling_cmd_enum! {
100100 /// Segment to append to the path.
101101 /// This segment will implicitly begin at the current "pen" location.
102102 pub segment: PathSegment ,
103+ /// Optional label to associate with the new path segment.
104+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
105+ pub label: Option <String >,
103106 }
104107
105-
106108 /// Command for extruding a solid 2d.
107109 #[ derive(
108110 Debug , Clone , PartialEq , Serialize , Deserialize , JsonSchema , ModelingCmdVariant ,
@@ -128,6 +130,28 @@ define_modeling_cmd_enum! {
128130 pub extrude_method: ExtrudeMethod ,
129131 }
130132
133+ /// Command for extruding a solid 2d to a reference geometry.
134+ #[ derive(
135+ Debug , Clone , PartialEq , Serialize , Deserialize , JsonSchema , ModelingCmdVariant ,
136+ ) ]
137+ #[ cfg_attr( feature = "ts-rs" , derive( ts_rs:: TS ) ) ]
138+ #[ cfg_attr( feature = "ts-rs" , ts( export_to = "ModelingCmd.ts" ) ) ]
139+ pub struct ExtrudeToReference {
140+ /// Which sketch to extrude.
141+ /// Must be a closed 2D solid.
142+ pub target: ModelingCmdId ,
143+ /// Reference to extrude to.
144+ /// Extrusion occurs along the target's normal until it is as close to the reference as possible.
145+ pub reference: ExtrudeReference ,
146+ /// Which IDs should the new faces have?
147+ /// If this isn't given, the engine will generate IDs.
148+ #[ serde( default ) ]
149+ pub faces: Option <ExtrudedFaceInfo >,
150+ /// Should the extrusion create a new object or be part of the existing object.
151+ #[ serde( default ) ]
152+ pub extrude_method: ExtrudeMethod ,
153+ }
154+
131155 fn default_twist_extrude_section_interval( ) -> Angle {
132156 Angle :: from_degrees( 15.0 )
133157 }
@@ -568,8 +592,8 @@ define_modeling_cmd_enum! {
568592 pub start_angle: Angle ,
569593 /// Is the helix rotation clockwise?
570594 pub is_clockwise: bool ,
571- /// Length of the helix.
572- pub length: LengthUnit ,
595+ /// Length of the helix. If None, the length of the cylinder will be used instead.
596+ pub length: Option < LengthUnit > ,
573597 }
574598
575599 /// Create a helix using the specified parameters.
0 commit comments