forked from 1b-agent/opencadstudio-upstream
Feat: Solid entity (2D) — render, grips, properties, transform
TruckConvertible renders the 4 perimeter edges as wireframe outline. The scene injects a solid-fill HatchModel for the filled quad using the existing hatch GPU pipeline (DXF Z-order: p0→p1→p3→p2). Grippable provides 4 square corner grips; grip moves rebuild the fill model. PropertyEditable exposes all 4 corners and thickness. Transformable handles move/rotate/scale/mirror via the standard entity transform path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
749f3b99dc
commit
e38aa6b611
4 files changed
+214
-20
No files matched your search
@@ -52,6 +52,7 @@ impl EntityTypeOps for EntityType {
|
||||
EntityType::AttributeEntity(a) => TruckConvertible::to_truck(a, document),
|
||||
EntityType::MLine(ml) => TruckConvertible::to_truck(ml, document),
|
||||
EntityType::Tolerance(tol) => TruckConvertible::to_truck(tol, document),
|
||||
EntityType::Solid(solid) => TruckConvertible::to_truck(solid, document),
|
||||
EntityType::Face3D(f) => TruckConvertible::to_truck(f, document),
|
||||
EntityType::PolygonMesh(pm) => TruckConvertible::to_truck(pm, document),
|
||||
EntityType::PolyfaceMesh(pfm) => TruckConvertible::to_truck(pfm, document),
|
||||
@@ -82,6 +83,7 @@ impl EntityTypeOps for EntityType {
|
||||
EntityType::AttributeEntity(a) => Grippable::grips(a),
|
||||
EntityType::MLine(ml) => Grippable::grips(ml),
|
||||
EntityType::Tolerance(tol) => Grippable::grips(tol),
|
||||
EntityType::Solid(solid) => Grippable::grips(solid),
|
||||
EntityType::Face3D(f) => Grippable::grips(f),
|
||||
EntityType::PolygonMesh(pm) => Grippable::grips(pm),
|
||||
EntityType::PolyfaceMesh(pfm) => Grippable::grips(pfm),
|
||||
@@ -165,6 +167,10 @@ impl EntityTypeOps for EntityType {
|
||||
tol,
|
||||
text_style_names,
|
||||
)),
|
||||
EntityType::Solid(solid) => Some(PropertyEditable::geometry_properties(
|
||||
solid,
|
||||
text_style_names,
|
||||
)),
|
||||
EntityType::Face3D(f) => Some(PropertyEditable::geometry_properties(
|
||||
f,
|
||||
text_style_names,
|
||||
@@ -242,6 +248,7 @@ impl EntityTypeOps for EntityType {
|
||||
EntityType::AttributeEntity(a) => PropertyEditable::apply_geom_prop(a, field, value),
|
||||
EntityType::MLine(ml) => PropertyEditable::apply_geom_prop(ml, field, value),
|
||||
EntityType::Tolerance(tol) => PropertyEditable::apply_geom_prop(tol, field, value),
|
||||
EntityType::Solid(solid) => PropertyEditable::apply_geom_prop(solid, field, value),
|
||||
EntityType::Face3D(f) => PropertyEditable::apply_geom_prop(f, field, value),
|
||||
EntityType::PolygonMesh(pm) => PropertyEditable::apply_geom_prop(pm, field, value),
|
||||
EntityType::PolyfaceMesh(pfm) => PropertyEditable::apply_geom_prop(pfm, field, value),
|
||||
@@ -278,6 +285,7 @@ impl EntityTypeOps for EntityType {
|
||||
EntityType::AttributeEntity(a) => Grippable::apply_grip(a, grip_id, apply),
|
||||
EntityType::MLine(ml) => Grippable::apply_grip(ml, grip_id, apply),
|
||||
EntityType::Tolerance(tol) => Grippable::apply_grip(tol, grip_id, apply),
|
||||
EntityType::Solid(solid) => Grippable::apply_grip(solid, grip_id, apply),
|
||||
EntityType::Face3D(f) => Grippable::apply_grip(f, grip_id, apply),
|
||||
EntityType::PolygonMesh(pm) => Grippable::apply_grip(pm, grip_id, apply),
|
||||
EntityType::PolyfaceMesh(pfm) => Grippable::apply_grip(pfm, grip_id, apply),
|
||||
@@ -316,6 +324,7 @@ impl EntityTypeOps for EntityType {
|
||||
EntityType::AttributeEntity(a) => Transformable::apply_transform(a, t),
|
||||
EntityType::MLine(ml) => Transformable::apply_transform(ml, t),
|
||||
EntityType::Tolerance(tol) => Transformable::apply_transform(tol, t),
|
||||
EntityType::Solid(solid) => Transformable::apply_transform(solid, t),
|
||||
EntityType::Face3D(f) => Transformable::apply_transform(f, t),
|
||||
EntityType::PolygonMesh(pm) => Transformable::apply_transform(pm, t),
|
||||
EntityType::PolyfaceMesh(pfm) => Transformable::apply_transform(pfm, t),
|
||||
|
||||
Reference in new issue
Block a user