Message 1 of 2
Eliminate Redundant Points

Not applicable
05-24-2006
05:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
' 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