Expand description
KittyCAD’s Modeling API lets you design 3D models.
§Beware
This project does not use semver. We are using 0.1.x for everything. If you use this crate, commit your Cargo.lock to avoid being broken when we publish a new version. Why? Because we use this primarily for KittyCAD server and clients, where we are on top of all changes.
Re-exports§
pub use ok_response::output;
Modules§
- Base64 data that encodes to url safe base64, but can decode from multiple base64 implementations to account for various clients and libraries. Compatible with serde and JsonSchema.
- Various coordinate systems.
- chrono wrapper for datetimes.
- Definition of each modeling command.
- Import and export types.
- Modeling command IDs, used to associated requests and responses. Also used to construct commands which refer to previous commands.
- A little macro for easy implementation of cxx::ExternType
- A length unit is a type that converts a length value from one unit to another. In the case of the engine we will always convert to millimeters, since that is what the engine uses.
- When a modeling command is successful, these responses could be returned.
- Controlling the rendering session.
- Types that are shared between various modeling commands, like Point3d.
- Units of measurement.
- Types for the WebSocket API. Types for the websocket server.
Macros§
- This tells the c++ interop what the native c++ names are from https://docs.rs/cxx/latest/src/cxx/extern_type.rs.html
Structs§
- Camera drag ended
- Camera drag continued.
- Camera drag started.
- Get the center of mass of entities in the scene or the default scene.
- Closes a path, converting it to a 2D solid.
- Get control points of the given curve.
- Find the start and end of a curve.
- Get type of the given curve.
- Get the plane for sketch mode.
- Updates the camera to center to the center of the current selection (or the origin if nothing is selected)
- Focus the default camera upon an object in the scene.
- Gets the default camera’s camera settings
- Change what the default camera is looking at.
- Change what the default camera is looking at.
- Use orthographic projection.
- Use perspective projection.
- Adjust zoom of the default camera.
- Get the density of entities in the scene or the default scene.
- Sets whether or not changes to the scene or its objects will be done as a “dry run” In a dry run, successful commands won’t actually change the model. This is useful for catching errors before actually making the change.
- Changes visibility of scene-wide edge lines on brep solids
- Sets whether or not changes to the scene or its objects will be done as a “dry run” In a dry run, successful commands won’t actually change the model. This is useful for catching errors before actually making the change.
- Sketch on some entity (e.g. a plane, a face).
- Create a circular pattern using this entity.
- Fade entity in or out.
- What are all UUIDs of this entity’s children?
- What is the UUID of this entity’s n-th child?
- What is the distance between these two entities?
- How many children does the entity have?
- What is this entity’s parent?
- What are all UUIDs of all the paths sketched on top of this entity?
- Create a linear pattern using this entity.
- Create a pattern using this entity by specifying the transform for each desired repetition. Transformations are performed in the following order (first applied to last applied): scale, rotate, translate.
- Create a helix using the input cylinder and other specified parameters.
- Mirror the input entities over the specified axis. (Currently only supports sketches)
- Mirror the input entities over the specified edge. (Currently only supports sketches)
- Set opacity of the entity.
- Export the scene to a file.
- 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. - Command for extruding a solid 2d.
- Obtains the surface “center of mass”
- Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v
- Determines a position on a brep face evaluated by parameters u,v
- Determines whether a brep face is planar and returns its surface-local planar axes if so
- What type of entity is this?
- Get the number of objects in the scene
- Get the plane for sketch mode.
- Stop dragging the mouse.
- Continue dragging the mouse.
- Start dragging the mouse.
- Changes the current highlighted entity to these entities.
- 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.
- File to import into the current model. If you are sending binary data for a file, be sure to send the WebSocketRequest as binary/bson, not text/json.
- Import files to the current model.
- Command for lofting sections to create a solid
- Add a gizmo showing the axes.
- Make a new plane
- Get the mass of entities in the scene or the default scene.
- Send a mouse click event Updates modified/selected entities.
- Send a mouse move event
- Move the path’s “pen”. If you’re in sketch mode, these coordinates are in the local coordinate system, not the world’s coordinate system. For example, say you’re sketching on the plane {x: (1,0,0), y: (0,1,0), origin: (0, 0, 50)}. In other words, the plane 50 units above the default XY plane. Then, moving the pen to (1, 1, 0) with this command uses local coordinates. So, it would move the pen to (1, 1, 50) in global coordinates.
- Create a new annotation
- Bring an object to the front of the scene
- Set the material properties of an object
- Hide or show an object
- Obtain curve id by index
- Obtain curve ids for vertex ids
- Query the given path.
- Obtain the sketch target id (if the path was drawn in sketchmode) for a path
- Obtain vertex ids for a path
- Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates.
- Set the color of a plane.
- Reconfigure the stream.
- Remove scene objects.
- Command for revolving a solid 2d.
- Command for revolving a solid 2d about a brep edge
- Removes all of the Objects in the scene
- Adds one or more entities (by UUID) to the selection.
- Clear the selection
- Find all IDs of selected entities
- Removes one or more entities (by UUID) from the selection.
- Replaces current selection with these entities (by UUID).
- Modifies the selection by simulating a “mouse click” at the given x,y window coordinate Returns ID of whatever was selected.
- Send object to front or back.
- Set the background color of the scene.
- Set the properties of the tool lines for the scene.
- Set the default system properties used when a specific property isn’t set.
- Set the units of the scene. For all following commands, the units will be interpreted as the given units.
- What kind of entities can be selected?
- When you select some entity with the current tool, what should happen to the entity?
- Set the current tool.
- 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.
- Add a hole to a Solid2d object before extruding it.
- Fillets the given edge with the specified radius.
- Gets all faces which use the given edge.
- Gets all edges which are opposite the given edge, across all possible faces.
- Gets the shared edge between these two faces if it exists
- Get a concise description of all of an extrusion’s faces.
- Gets the next adjacent edge for the given edge, along the given face.
- Gets the edge opposite the given edge, along the given face.
- Gets the previous adjacent edge for the given edge, along the given face.
- Command for shelling a solid3d face
- Start a new path.
- Get the surface area of entities in the scene or the default scene.
- Take a snapshot of the current view.
- Update an annotation
- Fit the view to the scene with an isometric view.
- Get the volume of entities in the scene or the default scene.
- Fit the view to the specified object(s).
Enums§
- Enum containing the variety of image formats snapshots may be exported to.
- Commands that the KittyCAD engine can execute.
- Each modeling command (no parameters or fields).
Traits§
- Anything that can be a ModelingCmd output.
- Some modeling command executed on the KittyCAD engine.