Skip to content

Compound / assembly modeling in EzyCad #59

Description

@trailcode

Status: Open — deferred for design discussion; revisit later.

Context

  • STEP assemblies (e.g. multi-part crankshaft .stp files) often define many PRODUCT entities in the file. Example: B5D-E1400-00 CRANKSHAFT ASSY YAMAHA FREEGO LTK125.stp contains 9 PRODUCT lines in the STEP text.
  • Open CASCADE may still deliver one top-level TopoDS_Shape (often a TopoDS_Compound) after TransferRoots(), rather than nine separate roots—behavior depends on the exporter and reader settings.
  • Performance and UX (move, tessellation, selection) are heavy when the whole assembly is one large compound mesh.

Current behavior (EzyCad)

  • Each document shape is a Shp (AIS_Shape) holding a TopoDS_Shape. Compounds are already valid B-rep; BRepTools::Write / Read in project JSON preserves topology.
  • m_shps is a flat list—no scene hierarchy, assembly tree, or named instances in the document model.
  • Export already builds a TopoDS_Compound when merging multiple selected shapes (build_export_shape_).

Gaps (what “compound support” could mean)

  1. Workflow: Explode or split a compound into multiple Shp entries for editing; optionally group selected shapes into one compound.
  2. UI: Scene tree showing children of compounds; clearer selection of sub-solids (depends on OCCT selection modes).
  3. STEP: Optional import strategies (e.g. split roots, or STEPCAF / XCAF) for assembly metadata, names, and structure.
  4. Long-term: Full XCAF-based assembly model and richer STEP round-trip.

Suggested directions (when revisiting)

Tier Scope Notes
1 Explode / group compounds TopExp_Explorer or TopoDS_Iterator; replace one Shp with N, or merge N into one compound; undo integration.
2 Tree panel + import tweaks List m_shps and compound children; optional STEP post-split for multiple roots.
3 XCAF / STEPCAF Product tree, colors, instance transforms; large effort.

Related work already done (same era)

  • PLY import/export, binary file open for import, import_step returns Status, .stp in import filter, batched redisplay for transforms, PLY export via mesh writer (not DEPLY_Provider).

References

  • OCCT: TopoDS_Compound, TopExp_Explorer, STEPControl_Reader, optional STEPCAFControl_Reader / XCAF.
  • Code: Occt_view::import_step, build_export_shape_, m_shps / to_json shape array in occt_view.cpp.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions