path2.isCCW
#929
Replies: 1 comment 3 replies
-
An alternative would be to use area() from maths utils, which also does the same calculation. CCW handedness would be any positive area (given that the path does not cross itself.) const { path2 } = require('@jscad/modeling').geometries
const { area } = require('@jscad/modeling').maths.utils
const areaunderpath = area(path2.toPoints(mypath)) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There is occasional need to check handiness of a path, and there is a simple function to do so, but it has it's limitations.
Since the topic needs further investigation, the function is not part of jscad but is left here for those that need it, and to allow more investigation into the problem.
If you create a path than it is better to make sure that it is CCW before extruding, but for cases where you get a path from external source you may need to check it.
Beta Was this translation helpful? Give feedback.
All reactions