Skip to content

Fix tube triangulation at line bends#15

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/fix-bend-tube-issues
Draft

Fix tube triangulation at line bends#15
Copilot wants to merge 4 commits into
masterfrom
copilot/fix-bend-tube-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 1, 2025

Line triangulation created duplicate circles with misaligned orientations at bend points, causing gaps/overlaps in the tube geometry.

Changes

LineTriangulator.GetCircles() - Generate one circle per line point instead of two per segment:

  • Start/end points: perpendicular to adjacent segment
  • Interior points: perpendicular to normalized average of adjacent segment directions (bisector)
  • Handle 180° bends where direction vectors cancel

LineTriangulator.GetTriangles() - Remove i++ increment (no longer needed with 1:1 point-to-circle mapping)

Example

// Line with 90° bend: 3 points
var wkt = "LINESTRING(-10 0 0, 0 0 0, 0 10 0)";
var line = (LineString)Geometry.Deserialize<WktSerializer>(wkt);

// Old: 4 circles (2 per segment, 2 overlapping at bend)
// New: 3 circles (1 per point, smooth transition at bend)
var circles = LineTriangulator.GetCircles(line.ToVector3(), radius: 1, segments: 8);

Tests: Added BendTests.cs covering 90°, 135°, 180° bends and multi-bend scenarios.

Original prompt

when triangulating a line something goes wrong in the bends. Make correct tubes in the bends also


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 1, 2025 23:07
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix tube creation issues in triangulation bends Fix tube triangulation at line bends Nov 1, 2025
Copilot AI requested a review from bertt November 1, 2025 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants