mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-07 18:17:44 +00:00
Bind libslic3r's TriangleMesh directly with a shared_ptr holder rather than wrapping it in a HostTriangleMesh snapshot struct. ModelVolume.mesh() hands out the volume's own shared_ptr (via const_pointer_cast, which only serves the holder type), so the Python object pins the snapshot exactly as the wrapper did, and the zero-copy views now use the Python object as their array base — deleting the capsule machinery. The wrapper's type-level constness becomes a documented rule instead: handed-out meshes are copy-on-write snapshots shared across threads, so the binding exposes only const methods; a future mutable-mesh API must operate on plugin-owned copies handed back via ModelVolume::set_mesh. No Python-visible change (orca.host.TriangleMesh, same methods/docstrings), and plugins now hold the real class a future set_mesh() will accept. Verified with slic3rutils and fff_print suites.
5.5 KiB
5.5 KiB