Eliminate Redundant Points

Eliminate Redundant Points

Anonymous
Not applicable
335 Views
1 Reply
Message 1 of 2

Eliminate Redundant Points

Anonymous
Not applicable
I'm creating a set of arcs in a sketch and before I can extrude the profile I need to run the sketch doctor to eliminate redundant points. Is there a way to avoid this in the program?

' Determine the model origin relative to the sketch space.
Dim Points(2) As Point2d
For i = 0 To 2
Set Points(i) = oSketch.ModelToSketchSpace(oTG.CreatePoint(0, 0, 0))
Next
'

Dim oArc As SketchArc
R_In = 3.78
R = 3.9
rp = 0.07

Alpha = ArcSin((rp / 2) / R) * 2
Angle_Start = pi / 2 - (49.83 - 0.4668196) * pi / 180
Angle_Stop = pi / 2 + (49.83 + 0.4668196) * pi / 180

Current_Lenticule = 1

For Current_Angle = Angle_Start To Angle_Stop Step Alpha * 2

If Current_Lenticule = 1 Then

Points(0).X = R * 2.54 * Cos(Current_Angle)
Points(0).Y = R * 2.54 * Sin(Current_Angle)
'Outside lenticule
Points(1).X = R * 2.54 * Cos(Current_Angle - Alpha)
Points(1).Y = R * 2.54 * Sin(Current_Angle - Alpha)
Points(2).X = R * 2.54 * Cos(Current_Angle + Alpha)
Points(2).Y = R * 2.54 * Sin(Current_Angle + Alpha)
Set oArc = oSketch.SketchArcs.AddByCenterStartEndPoint(Points(0), Points(1), Points(2), True)
Else

Points(0).X = R * 2.54 * Cos(Current_Angle)
Points(0).Y = R * 2.54 * Sin(Current_Angle)
'Outside lenticule
Points(1).X = Points(2).X
Points(1).Y = Points(2).Y
Points(2).X = R * 2.54 * Cos(Current_Angle + Alpha)
Points(2).Y = R * 2.54 * Sin(Current_Angle + Alpha)
Set oArc = oSketch.SketchArcs.AddByCenterStartEndPoint(Points(0), oArc.EndSketchPoint, Points(2), True)
End If

Next

Thanks,
Jeff
0 Likes
336 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Did not know how to remove posting, but I found a bug that solved the problem.
0 Likes