Skip to content

Conversation

@thomaslepoix
Copy link
Member

@thomaslepoix thomaslepoix commented Jan 9, 2026

Fixes #19

This implementation adds two new classes:

  • Angle that model any angle that involve a diagonal Edge (either an edge extremity, an angle between adjacent Edges of the same polygon, or an angle between two unrelated crossing Edges).
  • ConflictDiagonalOrCircularZone that model a zone, delimited by two Angles (may contain some more angles), in which some diagonal edges form a consecutive sequence. The diagonal zone may span across several Interval (intervals between adjacent MeshlinePolicies).

In the process, the first step is to decide if each angle must produce MeshlinePolicies (both horizontal and vertical). Criteria being: if angles are extremity of a diagonal zone or acute enough to be considered of particular interest.
The second step is to propagate diagonal zone specific parameters to every Intervals that are part of the zone.


Trying instructions:

  • Run the mesher.
nix develop
	cmake -S . -B build
	cmake --build build #-j

	build/src/openemsh test/diagonal.csx \
		-Gv \
		--proximity-limit 0.1 \
		--lmin 2 \
		--dmax 2 \
		--diag-dmax 0.2 \
		--diag-minimal-angle 40

Note: at a first look, you will notice some groups of 3 meshlines that look "too close". This occurs at the middle of Intervals when smoothness is around 1 (visually regular spacing between lines, across multiple Intervals). Something must be tweaked there for this particular case, but it is not related to the current part of code.

  • Zoom on the middle-top shape.

  • Click on it and select the horizontal ConflictDiagonalOrCircularZone.

  • Observe its span across multiple diagonal edges, multiples angles, and its correlation with the mesh resolution.

  • Press [SPACE] to edit it and set Diagonal dmax from 0.2 to 0.15 to make the vertical mesh tighter.

  • Click and select all the 9 angles of this shape (around the rounded part + 2 others at the right).

  • Observe some are acute enough to be fully enabled (green) while some others are obtuse and dismissed (red), except if those are also the extremity of a diagonal zone in one axis or another (the top-most and the left-most).

  • Zoom on a fully enabled Angle and see how it is placed at the center of a mesh cell square. Zoom on a fully dismissed Angle and see that meshlines does not seem to be placed regarding it.

  • Unselect all [ESC], edit globally [SPACE] and set Minimal angle from 40 to 20.

  • Zoom on an angle that previously was totally dismissed, selected it. It should be now fully green, and at the center of a mesh cell.

  • Zoom on the small vertical edge at the bottom-right of the shape, observe the Thirds rule is correctly applied (the edge being placed at the third of the mesh cell) while being in a diagonal zone.

  • To see another example, open test/MStest.csx [CTRL]+[O], toggle the mesh visibility [.] and [X] and take a look.

@thomaslepoix thomaslepoix added the core Domain AKA business logic label Jan 9, 2026
@thomaslepoix thomaslepoix force-pushed the dev/handle-diagonals branch 3 times, most recently from ebbde94 to 4884871 Compare January 10, 2026 00:22
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
10.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@thomaslepoix thomaslepoix merged commit c2a8263 into main Jan 12, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Domain AKA business logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle diagonal/circular edges

2 participants