forked from 1b-agent/opencadstudio-upstream
feat(snap): independent 3D object-snap system with six modes
Grid snap locks to SNAPUNIT instead of magnetizing; snapped 3D points keep elevation instead of flattening to z=0. New SnapTypes Vertex/EdgeMidpoint/FaceCenter/Knot/FacePerpendicular/NearestFace with their own F4 master toggle and mode set, tiers, and markers, fully independent of the 2D master. Solid B-rep corners/edge-midpoints/face-centers from mesh edges and kernel faces, spline knot points, and live perpendicular/nearest-to-face on mesh triangles merged priority-aware in move/click paths. Drafting Settings 3D Object Snap tab is fully live (was dead placeholders); Nearest-to-face off by default. TDD: behavioral LINE-to-solid tests plus engine/scene unit tests.
This commit is contained in:
1 parent
d894b8eb05
commit
ca0ee37d26
16 files changed
+1728
-67
No files matched your search
+11
-2
@@ -193,7 +193,9 @@ const SNAP_ORDER: &[SnapType] = &[
|
||||
];
|
||||
|
||||
/// `$OSMODE` bit for each running object-snap mode.
|
||||
/// `None` for OCS-only snaps (Grid, ObjectPick) that have no standard bit.
|
||||
/// `None` for OCS-only snaps (Grid, ObjectPick) and the 3D solid snaps
|
||||
/// (Vertex, EdgeMidpoint, FaceCenter, Knot, FacePerpendicular, NearestFace),
|
||||
/// which live in the separate 3D set and have no standard bit.
|
||||
fn snap_bit(s: SnapType) -> Option<i32> {
|
||||
Some(match s {
|
||||
SnapType::Endpoint => 1,
|
||||
@@ -209,7 +211,14 @@ fn snap_bit(s: SnapType) -> Option<i32> {
|
||||
SnapType::ApparentIntersection => 2048,
|
||||
SnapType::Extension => 4096,
|
||||
SnapType::Parallel => 8192,
|
||||
SnapType::Grid | SnapType::ObjectPick => return None,
|
||||
SnapType::Grid
|
||||
| SnapType::ObjectPick
|
||||
| SnapType::Vertex
|
||||
| SnapType::EdgeMidpoint
|
||||
| SnapType::FaceCenter
|
||||
| SnapType::Knot
|
||||
| SnapType::FacePerpendicular
|
||||
| SnapType::NearestFace => return None,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user