forked from 1b-agent/opencadstudio-upstream
feat: BOX, SPHERE, CYLINDER primitives + EXTRUDE / REVOLVE commands
BOX, SPHERE, and CYLINDER build truck topology solids and tessellate them into MeshModels stored alongside a Solid3D placeholder entity so the GPU mesh pipeline renders them immediately. EXTRUDE picks any closed 2D profile (Circle, LwPolyline, etc.), attaches a planar face via try_attach_plane, and translational-sweeps it (tsweep Face → Solid) along Z by the given height. REVOLVE picks a profile, two axis points, and an angle (default 360°), then rotational-sweeps the wire (rsweep) around the axis. Three new CmdResult variants drive the operations: CommitSolid3D, ExtrudeEntity, RevolveEntity. Scene::layer_color() added to retrieve the active layer's RGBA color. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
a773a1a1f1
commit
549ae38459
7 files changed
+592
-1
No files matched your search
@@ -138,6 +138,21 @@ pub enum CmdResult {
|
||||
/// Translation vector to apply to vertices inside the window.
|
||||
delta: Vec3,
|
||||
},
|
||||
/// Create a Solid3D placeholder entity + associated MeshModel.
|
||||
/// `mesh_fn` is called with the entity's handle string to build the mesh.
|
||||
CommitSolid3D {
|
||||
mesh_fn: Box<dyn FnOnce(String) -> Option<crate::scene::mesh_model::MeshModel> + Send>,
|
||||
},
|
||||
/// Extrude the profile entity `handle` by `height` along Z.
|
||||
ExtrudeEntity { handle: Handle, height: f32, color: [f32; 4] },
|
||||
/// Revolve the profile entity `handle` around the given axis by `angle_deg`.
|
||||
RevolveEntity {
|
||||
handle: Handle,
|
||||
axis_start: glam::Vec3,
|
||||
axis_end: glam::Vec3,
|
||||
angle_deg: f32,
|
||||
color: [f32; 4],
|
||||
},
|
||||
/// INSERT landed on a block that has AttributeDefinitions.
|
||||
/// The host should look up the attdefs for `block_name` from the document
|
||||
/// and call `attreq_set_attdefs()` on the command, then loop on text input.
|
||||
|
||||
Reference in new issue
Block a user