#[non_exhaustive]pub enum ModelingCmd {
Show 100 variants
StartPath(StartPath),
MovePathPen(MovePathPen),
ExtendPath(ExtendPath),
Extrude(Extrude),
Revolve(Revolve),
Solid3dShellFace(Solid3dShellFace),
RevolveAboutEdge(RevolveAboutEdge),
ClosePath(ClosePath),
CameraDragStart(CameraDragStart),
CameraDragMove(CameraDragMove),
CameraDragEnd(CameraDragEnd),
DefaultCameraGetSettings(DefaultCameraGetSettings),
DefaultCameraLookAt(DefaultCameraLookAt),
DefaultCameraPerspectiveSettings(DefaultCameraPerspectiveSettings),
DefaultCameraZoom(DefaultCameraZoom),
Export(Export),
EntityGetParentId(EntityGetParentId),
EntityGetNumChildren(EntityGetNumChildren),
EntityGetChildUuid(EntityGetChildUuid),
EntityGetAllChildUuids(EntityGetAllChildUuids),
EntityGetDistance(EntityGetDistance),
EntityLinearPatternTransform(EntityLinearPatternTransform),
EntityLinearPattern(EntityLinearPattern),
EntityCircularPattern(EntityCircularPattern),
EntityMakeHelix(EntityMakeHelix),
EntityMirror(EntityMirror),
EditModeEnter(EditModeEnter),
SelectWithPoint(SelectWithPoint),
SelectAdd(SelectAdd),
SelectRemove(SelectRemove),
SceneClearAll(SceneClearAll),
SelectReplace(SelectReplace),
HighlightSetEntity(HighlightSetEntity),
HighlightSetEntities(HighlightSetEntities),
NewAnnotation(NewAnnotation),
UpdateAnnotation(UpdateAnnotation),
EdgeLinesVisible(EdgeLinesVisible),
ObjectVisible(ObjectVisible),
ObjectBringToFront(ObjectBringToFront),
ObjectSetMaterialParamsPbr(ObjectSetMaterialParamsPbr),
GetEntityType(GetEntityType),
Solid3dGetAllEdgeFaces(Solid3dGetAllEdgeFaces),
Solid2dAddHole(Solid2dAddHole),
Solid3dGetAllOppositeEdges(Solid3dGetAllOppositeEdges),
Solid3dGetOppositeEdge(Solid3dGetOppositeEdge),
Solid3dGetNextAdjacentEdge(Solid3dGetNextAdjacentEdge),
Solid3dGetPrevAdjacentEdge(Solid3dGetPrevAdjacentEdge),
Solid3dFilletEdge(Solid3dFilletEdge),
FaceIsPlanar(FaceIsPlanar),
FaceGetPosition(FaceGetPosition),
FaceGetCenter(FaceGetCenter),
FaceGetGradient(FaceGetGradient),
SendObject(SendObject),
EntitySetOpacity(EntitySetOpacity),
EntityFade(EntityFade),
MakePlane(MakePlane),
PlaneSetColor(PlaneSetColor),
SetTool(SetTool),
MouseMove(MouseMove),
MouseClick(MouseClick),
SketchModeDisable(SketchModeDisable),
GetSketchModePlane(GetSketchModePlane),
CurveSetConstraint(CurveSetConstraint),
EnableSketchMode(EnableSketchMode),
SetBackgroundColor(SetBackgroundColor),
SetCurrentToolProperties(SetCurrentToolProperties),
SetDefaultSystemProperties(SetDefaultSystemProperties),
CurveGetType(CurveGetType),
CurveGetControlPoints(CurveGetControlPoints),
TakeSnapshot(TakeSnapshot),
MakeAxesGizmo(MakeAxesGizmo),
PathGetInfo(PathGetInfo),
PathGetCurveUuidsForVertices(PathGetCurveUuidsForVertices),
PathGetVertexUuids(PathGetVertexUuids),
HandleMouseDragStart(HandleMouseDragStart),
HandleMouseDragMove(HandleMouseDragMove),
HandleMouseDragEnd(HandleMouseDragEnd),
RemoveSceneObjects(RemoveSceneObjects),
PlaneIntersectAndProject(PlaneIntersectAndProject),
CurveGetEndPoints(CurveGetEndPoints),
ReconfigureStream(ReconfigureStream),
ImportFiles(ImportFiles),
SetSceneUnits(SetSceneUnits),
Mass(Mass),
Density(Density),
Volume(Volume),
CenterOfMass(CenterOfMass),
SurfaceArea(SurfaceArea),
DefaultCameraFocusOn(DefaultCameraFocusOn),
SetSelectionType(SetSelectionType),
SetSelectionFilter(SetSelectionFilter),
DefaultCameraSetOrthographic(DefaultCameraSetOrthographic),
DefaultCameraSetPerspective(DefaultCameraSetPerspective),
ZoomToFit(ZoomToFit),
ViewIsometric(ViewIsometric),
Solid3dGetExtrusionFaceInfo(Solid3dGetExtrusionFaceInfo),
EditModeExit(EditModeExit),
SelectClear(SelectClear),
SelectGet(SelectGet),
GetNumObjects(GetNumObjects),
}
Expand description
Commands that the KittyCAD engine can execute.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StartPath(StartPath)
Start a new path.
MovePathPen(MovePathPen)
Move the path’s “pen”.
ExtendPath(ExtendPath)
Extend a path by adding a new segment which starts at the path’s “pen”.
If no “pen” location has been set before (via MovePen
), then the pen is at the origin.
Extrude(Extrude)
Command for extruding a solid 2d.
Revolve(Revolve)
Command for revolving a solid 2d.
Solid3dShellFace(Solid3dShellFace)
Command for revolving a solid 2d.
RevolveAboutEdge(RevolveAboutEdge)
Command for revolving a solid 2d about a brep edge
ClosePath(ClosePath)
Closes a path, converting it to a 2D solid.
CameraDragStart(CameraDragStart)
Camera drag started.
CameraDragMove(CameraDragMove)
Camera drag continued.
CameraDragEnd(CameraDragEnd)
Camera drag ended
DefaultCameraGetSettings(DefaultCameraGetSettings)
Gets the default camera’s camera settings
DefaultCameraLookAt(DefaultCameraLookAt)
Change what the default camera is looking at.
DefaultCameraPerspectiveSettings(DefaultCameraPerspectiveSettings)
Change what the default camera is looking at.
DefaultCameraZoom(DefaultCameraZoom)
Adjust zoom of the default camera.
Export(Export)
Export the scene to a file.
EntityGetParentId(EntityGetParentId)
What is this entity’s parent?
EntityGetNumChildren(EntityGetNumChildren)
How many children does the entity have?
EntityGetChildUuid(EntityGetChildUuid)
What is the UUID of this entity’s n-th child?
EntityGetAllChildUuids(EntityGetAllChildUuids)
What are all UUIDs of this entity’s children?
EntityGetDistance(EntityGetDistance)
What is the distance between these two entities?
EntityLinearPatternTransform(EntityLinearPatternTransform)
Create a linear pattern using this entity.
EntityLinearPattern(EntityLinearPattern)
Create a linear pattern using this entity.
EntityCircularPattern(EntityCircularPattern)
Create a circular pattern using this entity.
EntityMakeHelix(EntityMakeHelix)
Create a helix using the input cylinder and other specified parameters.
EntityMirror(EntityMirror)
Mirror the input entities over the specified axis. (Currently only supports sketches)
EditModeEnter(EditModeEnter)
Enter edit mode
SelectWithPoint(SelectWithPoint)
Modifies the selection by simulating a “mouse click” at the given x,y window coordinate Returns ID of whatever was selected.
SelectAdd(SelectAdd)
Adds one or more entities (by UUID) to the selection.
SelectRemove(SelectRemove)
Removes one or more entities (by UUID) from the selection.
SceneClearAll(SceneClearAll)
Removes all of the Objects in the scene
SelectReplace(SelectReplace)
Replaces current selection with these entities (by UUID).
HighlightSetEntity(HighlightSetEntity)
Changes the current highlighted entity to whichever one is at the given window coordinate. If there’s no entity at this location, clears the highlight.
HighlightSetEntities(HighlightSetEntities)
Changes the current highlighted entity to these entities.
NewAnnotation(NewAnnotation)
Create a new annotation
UpdateAnnotation(UpdateAnnotation)
Update an annotation
EdgeLinesVisible(EdgeLinesVisible)
Changes visibility of scene-wide edge lines on brep solids
ObjectVisible(ObjectVisible)
Hide or show an object
ObjectBringToFront(ObjectBringToFront)
Bring an object to the front of the scene
ObjectSetMaterialParamsPbr(ObjectSetMaterialParamsPbr)
Set the material properties of an object
GetEntityType(GetEntityType)
What type of entity is this?
Solid3dGetAllEdgeFaces(Solid3dGetAllEdgeFaces)
Gets all faces which use the given edge.
Solid2dAddHole(Solid2dAddHole)
Add a hole to a Solid2d object before extruding it.
Solid3dGetAllOppositeEdges(Solid3dGetAllOppositeEdges)
Gets all edges which are opposite the given edge, across all possible faces.
Solid3dGetOppositeEdge(Solid3dGetOppositeEdge)
Gets the edge opposite the given edge, along the given face.
Solid3dGetNextAdjacentEdge(Solid3dGetNextAdjacentEdge)
Gets the next adjacent edge for the given edge, along the given face.
Solid3dGetPrevAdjacentEdge(Solid3dGetPrevAdjacentEdge)
Gets the previous adjacent edge for the given edge, along the given face.
Solid3dFilletEdge(Solid3dFilletEdge)
Fillets the given edge with the specified radius.
FaceIsPlanar(FaceIsPlanar)
Determines whether a brep face is planar and returns its surface-local planar axes if so
FaceGetPosition(FaceGetPosition)
Determines a position on a brep face evaluated by parameters u,v
FaceGetCenter(FaceGetCenter)
Obtains the surface “center of mass”
FaceGetGradient(FaceGetGradient)
Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v
SendObject(SendObject)
Send object to front or back.
EntitySetOpacity(EntitySetOpacity)
Set opacity of the entity.
EntityFade(EntityFade)
Fade entity in or out.
MakePlane(MakePlane)
Make a new plane
PlaneSetColor(PlaneSetColor)
Set the color of a plane.
SetTool(SetTool)
Set the current tool.
MouseMove(MouseMove)
Send a mouse move event
MouseClick(MouseClick)
Send a mouse click event Updates modified/selected entities.
SketchModeDisable(SketchModeDisable)
Disable sketch mode. If you are sketching on a face, be sure to not disable sketch mode until you have extruded. Otherwise, your object will not be fused with the face.
GetSketchModePlane(GetSketchModePlane)
Get the plane for sketch mode.
CurveSetConstraint(CurveSetConstraint)
Get the plane for sketch mode.
EnableSketchMode(EnableSketchMode)
Sketch on some entity (e.g. a plane, a face).
SetBackgroundColor(SetBackgroundColor)
Set the background color of the scene.
SetCurrentToolProperties(SetCurrentToolProperties)
Set the properties of the tool lines for the scene.
SetDefaultSystemProperties(SetDefaultSystemProperties)
Set the default system properties used when a specific property isn’t set.
CurveGetType(CurveGetType)
Get type of the given curve.
CurveGetControlPoints(CurveGetControlPoints)
Get control points of the given curve.
TakeSnapshot(TakeSnapshot)
Take a snapshot of the current view.
MakeAxesGizmo(MakeAxesGizmo)
Add a gizmo showing the axes.
PathGetInfo(PathGetInfo)
Query the given path.
PathGetCurveUuidsForVertices(PathGetCurveUuidsForVertices)
Obtain curve ids for vertex ids
PathGetVertexUuids(PathGetVertexUuids)
Obtain vertex ids for a path
HandleMouseDragStart(HandleMouseDragStart)
Start dragging the mouse.
HandleMouseDragMove(HandleMouseDragMove)
Continue dragging the mouse.
HandleMouseDragEnd(HandleMouseDragEnd)
Stop dragging the mouse.
RemoveSceneObjects(RemoveSceneObjects)
Remove scene objects.
PlaneIntersectAndProject(PlaneIntersectAndProject)
Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates.
CurveGetEndPoints(CurveGetEndPoints)
Find the start and end of a curve.
ReconfigureStream(ReconfigureStream)
Reconfigure the stream.
ImportFiles(ImportFiles)
Import files to the current model.
SetSceneUnits(SetSceneUnits)
Set the units of the scene. For all following commands, the units will be interpreted as the given units.
Mass(Mass)
Get the mass of entities in the scene or the default scene.
Density(Density)
Get the density of entities in the scene or the default scene.
Volume(Volume)
Get the volume of entities in the scene or the default scene.
CenterOfMass(CenterOfMass)
Get the center of mass of entities in the scene or the default scene.
SurfaceArea(SurfaceArea)
Get the surface area of entities in the scene or the default scene.
DefaultCameraFocusOn(DefaultCameraFocusOn)
Focus the default camera upon an object in the scene.
SetSelectionType(SetSelectionType)
When you select some entity with the current tool, what should happen to the entity?
SetSelectionFilter(SetSelectionFilter)
What kind of entities can be selected?
DefaultCameraSetOrthographic(DefaultCameraSetOrthographic)
Use orthographic projection.
DefaultCameraSetPerspective(DefaultCameraSetPerspective)
Use perspective projection.
ZoomToFit(ZoomToFit)
Fit the view to the specified object(s).
ViewIsometric(ViewIsometric)
Fit the view to the scene with an isometric view.
Solid3dGetExtrusionFaceInfo(Solid3dGetExtrusionFaceInfo)
Get a concise description of all of an extrusion’s faces.
EditModeExit(EditModeExit)
Exit edit mode
SelectClear(SelectClear)
Clear the selection
SelectGet(SelectGet)
Find all IDs of selected entities
GetNumObjects(GetNumObjects)
Get the number of objects in the scene
Implementations§
source§impl ModelingCmd
impl ModelingCmd
sourcepub fn is_safe_to_batch(&self) -> bool
pub fn is_safe_to_batch(&self) -> bool
Is this command safe to run in an engine batch?
Trait Implementations§
source§impl Clone for ModelingCmd
impl Clone for ModelingCmd
source§fn clone(&self) -> ModelingCmd
fn clone(&self) -> ModelingCmd
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ModelingCmd
impl Debug for ModelingCmd
source§impl<'de> Deserialize<'de> for ModelingCmd
impl<'de> Deserialize<'de> for ModelingCmd
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<CmdVariant> From<CmdVariant> for ModelingCmdwhere
CmdVariant: ModelingCmdVariant,
impl<CmdVariant> From<CmdVariant> for ModelingCmdwhere
CmdVariant: ModelingCmdVariant,
source§impl From<ModelingCmd> for ModelingCmdEndpoint
impl From<ModelingCmd> for ModelingCmdEndpoint
You can easily convert each modeling command with its fields, into a modeling command without fields.
source§fn from(v: ModelingCmd) -> Self
fn from(v: ModelingCmd) -> Self
source§impl JsonSchema for ModelingCmd
impl JsonSchema for ModelingCmd
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more