Handle diagonal/circular edges #33
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Fixes #19
This implementation adds two new classes:
Anglethat 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).ConflictDiagonalOrCircularZonethat 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 severalInterval(intervals between adjacentMeshlinePolicies).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
Intervalsthat are part of the zone.Trying instructions:
Note: at a first look, you will notice some groups of 3 meshlines that look "too close". This occurs at the middle of
Intervalswhensmoothnessis 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 setDiagonal dmaxfrom0.2to0.15to 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 setMinimal anglefrom40to20.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.