You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One reason to trigger a "assertion failed" error in fixTJunctions appears to be related to empty polygons.
Those are created by functions such as rotateExtrude, followWith and polyhedron (depending on user input).
Below is an example. I think we should allow empty polygons but reTesselated() should remove them. What do you think? Also, polygon.getArea() is suitable to judge bad polys, but checking every poly might impact performance. Most of these bad polys might contain >1 identical vertices (rather than e.g. all vertices on a line), so that is possibly sufficient to check and may hit performance less. Any ideas there?
(Note, reTesselateCoplanarPolygons contains a check for degenerate polygons which I superficially fixed in last commit, but obviously doesn't capture most cases - this check might be improved as well)
function main() {
var cag = CAG.fromPoints([[1, 0], [0, 1], [0, 0]]);
var csg_fail = cag.rotateExtrude({
angle: 360,
resolution: 18
});
var csg_pass = CSG.fromPolygons(
csg_fail.polygons.filter(function(p){return p.getArea() > 1e-10}));
return csg_fail;
}
The text was updated successfully, but these errors were encountered:
see #60
If a polygon had two verices very close together, these may become truly
identical vertices after canonicalization. fiTJunctions choked on this.
Fix: canonicalization removes identical vertices from polygons.
fixTJunctionsdoes implicit canonicalization so the problem cannot occur
anymore.
see joostn/OpenJsCad#60
If a polygon had two verices very close together, these may become truly
identical vertices after canonicalization. fiTJunctions choked on this.
Fix: canonicalization removes identical vertices from polygons.
fixTJunctionsdoes implicit canonicalization so the problem cannot occur
anymore.
One reason to trigger a "assertion failed" error in fixTJunctions appears to be related to empty polygons.
Those are created by functions such as
rotateExtrude
,followWith
andpolyhedron
(depending on user input).Below is an example. I think we should allow empty polygons but
reTesselated()
should remove them. What do you think? Also,polygon.getArea()
is suitable to judge bad polys, but checking every poly might impact performance. Most of these bad polys might contain >1 identical vertices (rather than e.g. all vertices on a line), so that is possibly sufficient to check and may hit performance less. Any ideas there?(Note,
reTesselateCoplanarPolygons
contains a check for degenerate polygons which I superficially fixed in last commit, but obviously doesn't capture most cases - this check might be improved as well)The text was updated successfully, but these errors were encountered: