Ensure svgs have positive orientation by default

This commit is contained in:
Grant Sanderson
2023-01-26 12:04:58 -08:00
parent 72590a8fef
commit 05dd399270

View File

@ -320,8 +320,9 @@ class VMobjectFromSVGPath(VMobject):
self.set_points(self.get_points_without_null_curves())
# So triangulation doesn't get messed up
self.subdivide_intersections()
# Always default to orienting outward
if self.get_unit_normal()[2] < 0:
# Always default to orienting outward, account
# for the fact that this will get flipped in SVG.__init__
if self.get_unit_normal()[2] > 0:
self.reverse_points()
# Save for future use
PATH_TO_POINTS[path_string] = self.get_points().copy()