forked from 1b-agent/opencadstudio-upstream
fix(snap): arc segments of a polyline offer their centre and quadrants
Center and Quadrant found nothing on a polyline's bulge segments: the lightweight and heavy polylines carried no snap points for them, and a polyline split into several wires kept its points on one piece whose box the others' never reached. Each arc segment now carries its centre and quadrants, hovering the segment offers its centre, and a wire's box covers its snap points. Fixes #1640 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
29392de267
commit
fae64886ee
6 files changed
+150
-28
No files matched your search
@@ -493,7 +493,13 @@ fn centerline_metadata_2d(
|
||||
|
||||
impl RenderConvertible for Polyline2D {
|
||||
fn to_render(&self, document: &codec::CadDocument) -> Option<RenderEntity> {
|
||||
Some(tessellate_polyline2d(self, document.header.fill_mode))
|
||||
let mut render = tessellate_polyline2d(self, document.header.fill_mode);
|
||||
// Arc segments offer their centres and quadrants.
|
||||
if self.vertices.iter().any(|v| v.bulge != 0.0) {
|
||||
let entity = codec::EntityType::Polyline2D(self.clone());
|
||||
render.snap_pts.extend(crate::entities::curve::arc_segment_snaps(&entity));
|
||||
}
|
||||
Some(render)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user