forked from 1b-agent/opencadstudio-upstream
feat(dgn-ls): dash walls from start + fix wall connector and cap identity
DET pipe walls now carry the stroke pattern (dash_from_start), which tiles from each wall's own start vertex and skips the A-type end alignment that was force-lighting a solid dash under the end symbol. Two rendering fixes on top: - Dedup the host polyline's vertices before offsetting the walls. Some DGN pipe polylines carry trailing duplicate end vertices; a zero-length segment gave offset_xy a degenerate normal, leaving that vertex un-offset and folding the wall down to the centre line. The two walls' fold segments met at the centre and drew a spurious line linking them. - Re-key the symbol (end circle / half-ellipse) wires to the host handle so the whole pipe picks and selects as one entity instead of the symbols acting as separate phantom entities. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
765e6606e2
commit
48e6d0d553
42 files changed
+124
-8
No files matched your search
@@ -201,6 +201,15 @@ pub fn offset_host_entity(e: &EntityType, d: f64) -> Option<EntityType> {
|
||||
let mut clone = e.clone();
|
||||
match &mut clone {
|
||||
EntityType::LwPolyline(p) => {
|
||||
// Drop consecutive duplicate vertices first. A zero-length segment
|
||||
// gives `offset_xy` a degenerate normal, which leaves that vertex
|
||||
// un-offset — folding the wall down to the centre line and drawing a
|
||||
// spurious segment that visually links the two walls. (Some DGN pipe
|
||||
// polylines carry trailing duplicate end vertices.)
|
||||
p.vertices.dedup_by(|a, b| {
|
||||
(a.location.x - b.location.x).abs() < 1e-9
|
||||
&& (a.location.y - b.location.y).abs() < 1e-9
|
||||
});
|
||||
if p.vertices.len() < 2 {
|
||||
return None;
|
||||
}
|
||||
@@ -215,6 +224,10 @@ pub fn offset_host_entity(e: &EntityType, d: f64) -> Option<EntityType> {
|
||||
}
|
||||
}
|
||||
EntityType::Polyline2D(p) => {
|
||||
p.vertices.dedup_by(|a, b| {
|
||||
(a.location.x - b.location.x).abs() < 1e-9
|
||||
&& (a.location.y - b.location.y).abs() < 1e-9
|
||||
});
|
||||
if p.vertices.len() < 2 {
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user