Drawing one line to split a gemstone looks simple, but a surface mesh contains hundreds or thousands of connected triangles. A screen-space drag must become a depth-spanning plane, intersect triangles, create vertices, rebuild connectivity, and close the exposed boundary.
If topology, volume, and collision geometry disagree, thin polygons appear, faces go missing, or repeated cuts feed invalid values into physics. A convincing cut links stable geometry, interior light, piece motion, and sound.
A surface shell is not a filled solid
Most 3D models describe only an outer shell. Cutting that shell opens a boundary, so a new cap is required to form two closed volumes.
Research uses surface, tetrahedral, hexahedral, and virtual-node representations. A browser may favor responsiveness, but every approach changes mesh topology.
- Triangle surface
- Open boundary
- New cap
- Rendering and collision update
Turning a drag into a plane
Two screen points plus the camera depth direction define a plane. Signed distance classifies each vertex as positive, negative, or nearly on the plane.
Edges with opposite signs contain intersection points. Interpolation preserves the stroke better than snapping to existing vertices, while tolerances merge near-duplicates.
Redistributing triangles
Uncut triangles move to one output; intersected triangles are split. Both pieces share positions but need independent indices so they can separate.
Every already separated piece touched by the plane must be tested. Cutting only the first hit is inconsistent; cutting a non-intersecting piece creates stray polygons.
The invisible tool
The plane disappears from the final scene, while a thin trail during dragging can reveal only the active intersection.
Closing the new boundary
Intersection points form contours that are projected to the plane and triangulated into caps. Vertex order reverses across the two pieces so outward normals face opposite directions.
Only the new face receives interior material. The original fruit or gemstone silhouette remains unchanged after cutting.
Why transparent sections are difficult
Glass needs refraction, internal reflection, and thickness-dependent absorption rather than alpha alone. New normals redirect the environment and can brighten a fresh cut.
Overlapping transparency also creates ordering problems. Quality levels should spend their budget on readable contours and interior color rather than enabling every effect.
- Correct normals
- Thickness color
- Restrained refraction
- Stable transparency
- Mobile quality
From geometry to motion and sound
Each piece needs a new center of mass, mass estimate, and collider. A small separation prevents overlap without an explosive impulse.
Continuous cutting texture follows actual intersection length; separation and floor contact use distinct sounds. Empty-space drags remain silent.