Why it's not working? (please help)

Why it's not working? (please help)

Anonymous
Not applicable
502 Views
12 Replies
Message 1 of 13

Why it's not working? (please help)

Anonymous
Not applicable
Hi,

I'm trying to check a polyline direction using the following code (found
here). Sometimes it works ok, but sometimes not (please see attached file).
Please help me!

Thanks,

Andre


Sub cw()
' based on lisp file from
';; ! Copyright: (C) 2000, Four Dimension Technologies, Singapore
';; ! Contact : rakesh.rao@4d-technologies.com for help/support/info
Dim objPline As Object, entBasePnt As Double
Dim varCoords As Variant
Dim i As Integer
Dim dbltemppt(0 To 1) As Double
Dim varVertexList As Variant

Dim intCoordCnt As Integer
Dim pt1 As Variant, pt2 As Variant
Dim Direction As Double, dblVertexCnt As Double, temp As Double
ThisDrawing.Utility.GetEntity objPline, entBasePnt, vbCr & "Select closed
Polyline: "

varCoords = objPline.Coordinates
i = 0
ReDim varVertexList(0 To ((UBound(varCoords) + 1) / 2))

For intCoordCnt = 1 To UBound(varCoords) Step 2

dbltemppt(0) = varCoords(intCoordCnt - 1)
dbltemppt(1) = varCoords(intCoordCnt)
varVertexList(i) = dbltemppt
i = i + 1
Next intCoordCnt

i = 0
dblVertexCnt = UBound(varVertexList)

While i < dblVertexCnt - 1
pt1 = varVertexList(i)
pt2 = varVertexList(i + 1)
Direction = Direction + (pt1(1) * pt2(0))
i = i + 1
Wend

pt1 = varVertexList(dblVertexCnt - 1)
pt2 = varVertexList(0)
Direction = Direction + (pt1(1) * pt2(0))
i = 0: temp = 0

While i < dblVertexCnt - 1
pt1 = varVertexList(i)
pt2 = varVertexList(i + 1)
temp = temp + (pt1(1) * pt2(0))
i = i + 1
Wend

pt1 = varVertexList(0)
pt2 = varVertexList(dblVertexCnt - 1)
temp = temp + (pt1(1) * pt2(0))
Direction = 0.5 * (Direction - temp)

If Direction > 0 Then MsgBox "CW"
If Direction < 0 Then MsgBox "CCW"
If Direction = 0 Then MsgBox "?"

End Sub
0 Likes
503 Views
12 Replies
Replies (12)
Message 2 of 13

GTVic
Advisor
Advisor
I didn't follow your algorithm but I have one that is a bit more involved that should work... It uses trig functions so is slower but should be easy to follow.

[code]Option Explicit
Private Const M_PI = 3.14159265358979
Private Const M_PI_2 = 1.5707963267949
Private Type PointAngleType
x As Double
y As Double
AngleToNext As Double
End Type

Private Function GetAngle(x1 As Double, y1 As Double, x2 As Double, y2 As Double) As Double

Dim dX As Double, dY As Double, a As Double

dX = x2 - x1
dY = y2 - y1
If dX <> 0 Then
If dY <> 0 Then
a = Atn(dY / dX)
If dX < 0 Then a = a + M_PI
Do While (a < 0) Or (a >= (2# * M_PI))
a = a + (IIf(a < 0, 2#, -2#) * M_PI)
Loop
Else
If dX < 0 Then a = M_PI Else a = 0
End If
ElseIf dY <> 0 Then
If dY > 0 Then a = M_PI_2 Else a = M_PI + M_PI_2
Else
a = 999 ' no angle, points are identical
End If
GetAngle = a

End Function

Private Sub Direction()

Dim objPoly As AcadObject, dblBase(0 To 2) As Double, SumAngle As Double
Dim varCoords As Variant, dblPoints() As PointAngleType
Dim iStep As Integer, i As Long

On Error Resume Next
Err.Clear
ThisDrawing.Utility.GetEntity objPoly, dblBase, vbCr & "Select closed polyline: "
If Err.Number = 0 Then
On Error GoTo 0
If objPoly.ObjectName = "AcDbPolyline" Or objPoly.ObjectName = "AcDb2dPolyline" Then
iStep = IIf(objPoly.ObjectName = "AcDbPolyline", 2, 3)
varCoords = objPoly.Coordinates
For i = LBound(varCoords) To UBound(varCoords) Step iStep
ReDim Preserve dblPoints(0 To (i / iStep)) As PointAngleType
dblPoints(i / iStep).x = varCoords(i)
dblPoints(i / iStep).y = varCoords(i + 1)
Next i
If objPoly.Closed Then
ReDim Preserve dblPoints(0 To (i / iStep)) As PointAngleType
dblPoints(i / iStep).x = varCoords(0)
dblPoints(i / iStep).y = varCoords(1)
End If
For i = LBound(dblPoints) To UBound(dblPoints) - 1
dblPoints(i).AngleToNext = GetAngle(dblPoints(i).x, dblPoints(i).y, dblPoints(i + 1).x, dblPoints(i + 1).y)
Next i
' compare each segment angle to the next
' if the turn is to the right then add the turn angle to the total
' if the turn is to the left then subtract
SumAngle = 0#
For i = LBound(dblPoints) To UBound(dblPoints) - 2
If dblPoints(i).AngleToNext <> 999 Then
If dblPoints(i + 1).AngleToNext <> 999 Then
If Abs(dblPoints(i + 1).AngleToNext - dblPoints(i).AngleToNext) < 0.0000000001 Then
' angles in exact same direction = straight
SumAngle = SumAngle + 0#
ElseIf Sin(dblPoints(i).AngleToNext) + Sin(dblPoints(i + 1).AngleToNext) < 0.0000000001 Then
' angles in exact opposite direction = straight back
SumAngle = SumAngle + 0#
ElseIf (dblPoints(i + 1).AngleToNext < dblPoints(i).AngleToNext) Then
If (dblPoints(i + 1).AngleToNext > (dblPoints(i).AngleToNext - M_PI)) Then ' right
SumAngle = SumAngle + (dblPoints(i).AngleToNext - dblPoints(i + 1).AngleToNext)
Else ' left
SumAngle = SumAngle - (M_PI + M_PI - dblPoints(i).AngleToNext + dblPoints(i + 1).AngleToNext)
End If
Else ' next angle is greater than this angle
If dblPoints(i + 1).AngleToNext < (dblPoints(i).AngleToNext + M_PI) Then ' left
SumAngle = SumAngle - (dblPoints(i + 1).AngleToNext - dblPoints(i).AngleToNext)
Else ' right
SumAngle = SumAngle + (dblPoints(i).AngleToNext + M_PI + M_PI - dblPoints(i + 1).AngleToNext)
End If
End If
Else
' two consecutive points at the same location - use the last angle for the next calculation
dblPoints(i + 1).AngleToNext = dblPoints(i).AngleToNext
End If
End If
Next i
If SumAngle > 0 Then ' more right turns than left
MsgBox "Polygon is clockwise ", vbInformation, IIf(objPoly.Closed, "Closed Polyline", "Polyline is not Closed")
ElseIf SumAngle < 0 Then ' more left turns than right
MsgBox "Polygon is counterclockwise ", vbInformation, IIf(objPoly.Closed, "Closed Polyline", "Polyline is not Closed")
Else ' direction could be either
MsgBox "Could not determine direction ", vbInformation, IIf(objPoly.Closed, "Closed Polyline", "Polyline is not Closed")
End If
Else
MsgBox "Object is not a polyline ", vbInformation, "Message"
End If
Else
On Error GoTo 0
End If

End Sub[/code] Message was edited by: GTVic
0 Likes
Message 3 of 13

Anonymous
Not applicable
This is what I use to calculate areas
Its sign happens to depend on the direction of the polyline
so it might be what your looking for.
I haven't done extensive checking on the sign so I can't be
100% sure it's going to work for all cases
I leave the testing to you.

Sub POLDIR()
Dim polcoor As Variant
Dim epol As AcadLWPolyline
Dim esel As AcadSelectionSet
Dim fdatat(0) As Integer
Dim fdatav(0) As Variant
Dim i As Long
Dim j As Long
Dim cx() As Double
Dim cy() As Double
Dim Ctot1 As Double

On Error Resume Next
Set esel = ThisDrawing.SelectionSets.Add("selpol")
If Err.Number <> 0 Then
Set esel = ThisDrawing.SelectionSets("selpol")
End If
esel.Clear
fdatat(0) = 0
fdatav(0) = "LWPOLYLINE"
esel.SelectOnScreen fdatat, fdatav
Do While esel.Count > 0
Set epol = esel.Item(0)
polcoor = epol.Coordinates
ReDim cx((UBound(polcoor) + 1) / 2)
ReDim cy((UBound(polcoor) + 1) / 2)
j = 0
For i = 0 To UBound(polcoor) Step 2
cx(j) = polcoor(i)
cy(j) = polcoor(i + 1)
j = j + 1
Next i
Ctot1 = 0
For i = 0 To UBound(cx) - 1
Ctot1 = Ctot1 + (cx(i + 1) * cy(i))
Ctot1 = Ctot1 - (cx(i) * cy(i + 1))
Next i
Ctot1 = Ctot1 + (cx(0) * cy(UBound(cy) - 1))
Ctot1 = Ctot1 - (cx(UBound(cx) - 1) * cy(0))
If Ctot1 < 0 Then
MsgBox "Direction is CCW"
Else
MsgBox "Direction is CW"
End If
esel.Clear
esel.SelectOnScreen fdatat, fdatav
Loop
End Sub


--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"André Dantas Rocha "
<=?UTF-8?Q?Andr=C3=A9_Dantas_Rocha_?=> wrote in message
news:4862806@discussion.autodesk.com...
Hi,

I'm trying to check a polyline direction using the following code (found
here). Sometimes it works ok, but sometimes not (please see attached file).
Please help me!

Thanks,

Andre


Sub cw()
' based on lisp file from
';; ! Copyright: (C) 2000, Four Dimension Technologies, Singapore
';; ! Contact : rakesh.rao@4d-technologies.com for help/support/info
Dim objPline As Object, entBasePnt As Double
Dim varCoords As Variant
Dim i As Integer
Dim dbltemppt(0 To 1) As Double
Dim v
arVertexList As Variant

Dim intCoordCnt As Integer
Dim pt1 As Variant, pt2 As Variant
Dim Direction As Double, dblVertexCnt As Double, temp As Double
ThisDrawing.Utility.GetEntity objPline, entBasePnt, vbCr & "Select closed
Polyline: "

varCoords = objPline.Coordinates
i = 0
ReDim varVertexList(0 To ((UBound(varCoords) + 1) / 2))

For intCoordCnt = 1 To UBound(varCoords) Step 2

dbltemppt(0) = varCoords(intCoordCnt - 1)
dbltemppt(1) = varCoords(intCoordCnt)
varVertexList(i
) = dbltemppt
i = i + 1
Next intCoordCnt

i = 0
dblVertexCnt = UBound(varVertexList)

While i < dblVertexCnt - 1
pt1 = varVertexList(i)
pt2 = varVertexList(i + 1)
Direction = Direction + (pt1(1) * pt2(0))
i = i + 1
Wend

pt1 = varVertexList(dblVertexCnt - 1)
pt2 = varVertexList(0)
Direction = Direction + (pt1(1) * pt2(0))
i = 0: temp = 0

While i < dblVertexCnt - 1
pt1 = varVertexList(i)
pt2 = varVertexList(i + 1)
temp = temp + (pt1(1) * pt2(0))
i =
i + 1
Wend

pt1 = varVertexList(0)
pt2 = varVertexList(dblVertexCnt - 1)
temp = temp + (pt1(1) * pt2(0))
Direction = 0.5 * (Direction - temp)

If Direction > 0 Then MsgBox "CW"
If Direction < 0 Then MsgBox "CCW"
If Direction = 0 Then MsgBox "?"

End Sub
0 Likes
Message 4 of 13

Anonymous
Not applicable
Just a flash: Why not check the Normal property of a polyline?
0 Likes
Message 5 of 13

Anonymous
Not applicable
Because the normal is a vector perpendicular to the entitie's plane.
The plane does not have anything to do with the polyline's direction
--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


wrote in message news:4862947@discussion.autodesk.com...
Just a flash: Why not check the Normal property of a polyline?
0 Likes
Message 6 of 13

Anonymous
Not applicable
Yeah you're right 😞

Normal property (with plines) points in the direction of the Z axis, when the pline was drawn. This means if you drew it from bottom view then the 3rd value of the Normal vector is negative.

If I understand correctly, you are trying to find out, if a polyline was drawn clockwise?
Hope you sorted this out already, if not, try to search on the web. Here's one I found:
http://forum.java.sun.com/thread.jspa?threadID=564806&tstart=135
0 Likes
Message 7 of 13

Anonymous
Not applicable
Actually, I posted that same method
in answer to Andre´s post

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


wrote in message news:4863718@discussion.autodesk.com...
Yeah you're right 😞

Normal property (with plines) points in the direction of the Z axis, when
the pline was drawn. This means if you drew it from bottom view then the 3rd
value of the Normal vector is negative.

If I understand correctly, you are trying to find out, if a polyline was
drawn clockwise?
Hope you sorted this out already, if not, try to search on the web. Here's
one I found:
http://forum.java.sun.com/thread.jspa?threadID=564806&tstart=135
0 Likes
Message 8 of 13

Anonymous
Not applicable
Thank you very much GTVic. The function works well!!!


escreveu na mensagem news:4862922@discussion.autodesk.com...
I didn't follow your algorithm but I have one that is a bit more involved
that should work... It uses trig functions so is slower but should be easy
to follow.

[code]Option Explicit
Private Const M_PI = 3.14159265358979
Private Const M_PI_2 = 1.5707963267949
Private Type PointAngleType
x As Double
y As Double
AngleToNext As Double
End Type

Private Function GetAngle(x1 As Double, y1 As Double, x2 As Double, y2 As
Double) As Double

Dim dX As Double, dY As Double, a As Double

dX = x2 - x1
dY = y2 - y1
If dX <> 0 Then
If dY <> 0 Then
a = Atn(dY / dX)
If dX < 0 Then a = a + M_PI
Do While (a < 0) Or (a >= (2# * M_PI))
a = a + (IIf(a < 0, 2#, -2#) * M_PI)
Loop
Else
If dX < 0 Then a = M_PI Else a = 0
End If
ElseIf dY <> 0 Then
If dY > 0 Then a = M_PI_2 Else a = M_PI + M_PI_2
Else
a = 999 ' no angle, points are identical
End If
GetAngle = a

End Function

Private Sub Direction()

Dim objPoly As AcadObject, dblBase(0 To 2) As Double, SumAngle As Double
Dim varCoords As Variant, dblPoints() As PointAngleType
Dim iStep As Integer, i As Long

On Error Resume Next
Err.Clear
ThisDrawing.Utility.GetEntity objPoly, dblBase, vbCr & "Select closed
polyline: "
If Err.Number = 0 Then
On Error GoTo 0
If objPoly.ObjectName = "AcDbPolyline" Or objPoly.ObjectName =
"AcDb2dPolyline" Then
iStep = IIf(objPoly.ObjectName = "AcDbPolyline", 2, 3)
varCoords = objPoly.Coordinates
For i = LBound(varCoords) To UBound(varCoords) Step iStep
ReDim Preserve dblPoints(0 To (i / iStep)) As PointAngleType
dblPoints(i / iStep).x = varCoords(i)
dblPoints(i / iStep).y = varCoords(i + 1)
Next i
If objPoly.Closed Then
ReDim Preserve dblPoints(0 To (i / iStep)) As PointAngleType
dblPoints(i / iStep).x = varCoords(0)
dblPoints(i / iStep).y = varCoords(1)
End If
For i = LBound(dblPoints) To UBound(dblPoints) - 1
dblPoints(i).AngleToNext = GetAngle(dblPoints(i).x,
dblPoints(i).y, dblPoints(i + 1).x, dblPoints(i + 1).y)
Next i
' compare each segment angle to the next
' if the turn is to the right then add the turn angle to the
total
' if the turn is to the left then subtract
SumAngle = 0#
For i = LBound(dblPoints) To UBound(dblPoints) - 2
If dblPoints(i).AngleToNext <> 999 Then
If dblPoints(i + 1).AngleToNext <> 999 Then
If Abs(dblPoints(i + 1).AngleToNext -
dblPoints(i).AngleToNext) < 0.0000000001 Then
' angles in exact same direction = straight
SumAngle = SumAngle + 0#
ElseIf Sin(dblPoints(i).AngleToNext) +
Sin(dblPoints(i + 1).AngleToNext) < 0.0000000001 Then
' angles in exact opposite direction = straight
back
SumAngle = SumAngle + 0#
ElseIf (dblPoints(i + 1).AngleToNext <
dblPoints(i).AngleToNext) Then
If (dblPoints(i + 1).AngleToNext >
(dblPoints(i).AngleToNext - M_PI)) Then ' right
SumAngle = SumAngle +
(dblPoints(i).AngleToNext - dblPoints(i + 1).AngleToNext)
Else ' left
SumAngle = SumAngle - (M_PI + M_PI -
dblPoints(i).AngleToNext + dblPoints(i + 1).AngleToNext)
End If
Else ' next angle is greater than this angle
If dblPoints(i + 1).AngleToNext <
(dblPoints(i).AngleToNext + M_PI) Then ' left
SumAngle = SumAngle - (dblPoints(i +
1).AngleToNext - dblPoints(i).AngleToNext)
Else ' right
SumAngle = SumAngle +
(dblPoints(i).AngleToNext + M_PI + M_PI - dblPoints(i + 1).AngleToNext)
End If
End If
Else
' two consecutive points at the same location - use
the last angle for the next calculation
dblPoints(i + 1).AngleToNext =
dblPoints(i).AngleToNext
End If
End If
Next i
If SumAngle > 0 Then ' more right turns than left
MsgBox "Polygon is clockwise ", vbInformation,
IIf(objPoly.Closed, "Closed Polyline", "Polyline is not Closed")
ElseIf SumAngle < 0 Then ' more left turns than right
MsgBox "Polygon is counterclockwise ", vbInformation,
IIf(objPoly.Closed, "Closed Polyline", "Polyline is not Closed")
Else ' direction could be either
MsgBox "Could not determine direction ", vbInformation,
IIf(objPoly.Closed, "Closed Polyline", "Polyline is not Closed")
End If
Else
MsgBox "Object is not a polyline ", vbInformation, "Message"
End If
Else
On Error GoTo 0
End If

End Sub[/code]

Message was edited by: GTVic
0 Likes
Message 9 of 13

Anonymous
Not applicable
Thank you very much Jorge. The function works well!!!

"Jorge Jimenez" escreveu na mensagem
news:4862954@discussion.autodesk.com...
This is what I use to calculate areas
Its sign happens to depend on the direction of the polyline
so it might be what your looking for.
I haven't done extensive checking on the sign so I can't be
100% sure it's going to work for all cases
I leave the testing to you.

Sub POLDIR()
Dim polcoor As Variant
Dim epol As AcadLWPolyline
Dim esel As AcadSelectionSet
Dim fdatat(0) As Integer
Dim fdatav(0) As Variant
Dim i As Long
Dim j As Long
Dim cx() As Double
Dim cy() As Double
Dim Ctot1 As Double

On Error Resume Next
Set esel = ThisDrawing.SelectionSets.Add("selpol")
If Err.Number <> 0 Then
Set esel = ThisDrawing.SelectionSets("selpol")
End If
esel.Clear
fdatat(0) = 0
fdatav(0) = "LWPOLYLINE"
esel.SelectOnScreen fdatat, fdatav
Do While esel.Count > 0
Set epol = esel.Item(0)
polcoor = epol.Coordinates
ReDim cx((UBound(polcoor) + 1) / 2)
ReDim cy((UBound(polcoor) + 1) / 2)
j = 0
For i = 0 To UBound(polcoor) Step 2
cx(j) = polcoor(i)
cy(j) = polcoor(i + 1)
j = j + 1
Next i
Ctot1 = 0
For i = 0 To UBound(cx) - 1
Ctot1 = Ctot1 + (cx(i + 1) * cy(i))
Ctot1 = Ctot1 - (cx(i) * cy(i + 1))
Next i
Ctot1 = Ctot1 + (cx(0) * cy(UBound(cy) - 1))
Ctot1 = Ctot1 - (cx(UBound(cx) - 1) * cy(0))
If Ctot1 < 0 Then
MsgBox "Direction is CCW"
Else
MsgBox "Direction is CW"
End If
esel.Clear
esel.SelectOnScreen fdatat, fdatav
Loop
End Sub


--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"André Dantas Rocha "
<=?UTF-8?Q?Andr=C3=A9_Dantas_Rocha_?=> wrote in message
news:4862806@discussion.autodesk.com...
Hi,

I'm trying to check a polyline direction using the following code (found
here). Sometimes it works ok, but sometimes not (please see attached file).
Please help me!

Thanks,

Andre


Sub cw()
' based on lisp file from
';; ! Copyright: (C) 2000, Four Dimension Technologies, Singapore
';; ! Contact : rakesh.rao@4d-technologies.com for help/support/info
Dim objPline As Object, entBasePnt As Double
Dim varCoords As Variant
Dim i As Integer
Dim dbltemppt(0 To 1) As Double
Dim v
arVertexList As Variant

Dim intCoordCnt As Integer
Dim pt1 As Variant, pt2 As Variant
Dim Direction As Double, dblVertexCnt As Double, temp As Double
ThisDrawing.Utility.GetEntity objPline, entBasePnt, vbCr & "Select closed
Polyline: "

varCoords = objPline.Coordinates
i = 0
ReDim varVertexList(0 To ((UBound(varCoords) + 1) / 2))

For intCoordCnt = 1 To UBound(varCoords) Step 2

dbltemppt(0) = varCoords(intCoordCnt - 1)
dbltemppt(1) = varCoords(intCoordCnt)
varVertexList(i
) = dbltemppt
i = i + 1
Next intCoordCnt

i = 0
dblVertexCnt = UBound(varVertexList)

While i < dblVertexCnt - 1
pt1 = varVertexList(i)
pt2 = varVertexList(i + 1)
Direction = Direction + (pt1(1) * pt2(0))
i = i + 1
Wend

pt1 = varVertexList(dblVertexCnt - 1)
pt2 = varVertexList(0)
Direction = Direction + (pt1(1) * pt2(0))
i = 0: temp = 0

While i < dblVertexCnt - 1
pt1 = varVertexList(i)
pt2 = varVertexList(i + 1)
temp = temp + (pt1(1) * pt2(0))
i =
i + 1
Wend

pt1 = varVertexList(0)
pt2 = varVertexList(dblVertexCnt - 1)
temp = temp + (pt1(1) * pt2(0))
Direction = 0.5 * (Direction - temp)

If Direction > 0 Then MsgBox "CW"
If Direction < 0 Then MsgBox "CCW"
If Direction = 0 Then MsgBox "?"

End Sub
0 Likes
Message 10 of 13

GTVic
Advisor
Advisor
Jorge, if this is the same algorithm as in the link below then it should work as long as the polygon does not intersect itself. The algorithm I posted is not as efficient but should work in any case (even if the polyline is not closed).

http://astronomy.swin.edu.au/~pbourke/geometry/polyarea/
0 Likes
Message 11 of 13

Anonymous
Not applicable
Haven't tested yours, but I'm sure it must do a good job.
But you see, there is no sense in finding the direction of a selft
intersecting poligon.
Say a bowtie for example, is has both directions !! one half is CCW and the
other is CW.

And anyway, there is always a way to use the algorithm I posted
Just find the intersection point and check for just the correct set of
vertices.

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

wrote in message news:4864383@discussion.autodesk.com...
Jorge, if this is the same algorithm as in the link below then it should
work as long as the polygon does not intersect itself. The algorithm I
posted is not as efficient but should work in any case (even if the polyline
is not closed).

http://astronomy.swin.edu.au/~pbourke/geometry/polyarea/
0 Likes
Message 12 of 13

GTVic
Advisor
Advisor
True, but there are cases where it can itersect and yet still be defined as CW or CCW ... for example if it crosses itself and then crosses back. Maybe as long as the number of intersections is even then a valid CW/CCW can still be found (just an hypothesis since I haven't bothered to check).
0 Likes
Message 13 of 13

Anonymous
Not applicable
Well you see, normally the direction info is useful for some analysis
in land, surveying and GIS applications, and probably for CNC too
and usually the type of polygon you're dealing with in these cases
can not and should not intersect with itself..

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


wrote in message news:4865470@discussion.autodesk.com...
True, but there are cases where it can itersect and yet still be defined as
CW or CCW ... for example if it crosses itself and then crosses back. Maybe
as long as the number of intersections is even then a valid CW/CCW can still
be found (just an hypothesis since I haven't bothered to check).
0 Likes