HOW TO MAKE POINT CONECTION ALWAYS PERPENDICULAR TO THE PLANE WHEN CHANGING ANGLE ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am beginning to create basic shapes with script . So when I create the elbow. It's has some problem appear with point connection. With A1=90 degrees. It's fine, however when I edit with A1=45 degrees. The point connection incorrect as show (point connection not perpendicular with elbow). I want to make a elbow with angle parameter. But I only create them when its has 90 degrees. Someone know this problem, please explain for me. Thank you for your support !
This is my code:
import aqa.math
import math
from varmain.primitiv import *
from varmain.var_basic import *
from varmain.custom import *
@Anonymous(Group="Elbow", TooltipShort="Elbow Insulation", TooltipLong="Insulation Elbow", Ports="2", LengthUnit="mm")
@group("MainDimensions")
@Anonymous(D1=LENGTH, TooltipShort="Radius of Elbow")
@Anonymous(R1=LENGTH, TooltipShort="Bend Radius")
@Anonymous(A1=ANGLE, TooltipShort="Bend Angle")
@Anonymous(S1=LENGTH, TooltipShort="Number of Segments")
@group(Name="meaningless enum")
@enum(1, "align X")
@enum(2, "align Y")
@enum(3, "align Z")
def Insulation_Elbow (s, D1 = 120.0, R1 = 152.0, A1 = 90.0, S1=4, ID = 'Insulation_Elbow', **kw):
o1 = ARC3DS(s, D=D1, R=R1 , A=A1, S=S1 )
s.setPoint((cos(A1)*R1, 0, 0), (cos(A1), 0, 0))
s.setPoint((0, cos(A1)*R1, 0), (0, cos(A1), 0))