skArc/Constraint syntax and radius calculation error

dvir_henn
dvir_henn Member Posts: 2 EDU

Hi! So I'm trying to create a custom feature and i've found a problem where i try to create an arc using 'skArc' and later define it using 'skConstraint' with '"constraintType" : ConstraintType.RADIUS' but while the original points defined in "start" and "end" are correct in the part studio the "mid" point and therefore the radius aren't correct.
Here's part of my code:

'''

StartPoint = vector((Radius - Belt_Tooth_Depth / 2) * sin(angle / 2), (Radius - Belt_Tooth_Depth / 2) * cos(angle / 2));
EndPoint = StartPoint + vector(-1,1) * millimeter;
MidPoint = StartPoint + vector(-0.5,2) * millimeter;
skArc(FirstSketch, "RootArc", {
"start" : StartPoint,
"mid" :MidPoint,
"end" : EndPoint,
});
skConstraint(FirstSketch, "RootArcRadius", {
"constraintType" : ConstraintType.RADIUS,
"localFirst" : "RooArc",
"magnitude" : RootRadius
});

'''

image.png

Here is what I'm getting when the starting point (the lower one) is at (6.26905, 35.55357, 0.00) and the end point is at the right position relative the first point. the middle point of the arc is at (7.12068, 37.40520, 0.00) instead of the intended (5.76905, 37.55357, 0.00), also 'RootRadius' is supposed to be equal to 4.34 millimeter but is actually equal to 1.08065 millimeter.
Is there a reason this is happening and am I wrong in my syntax? Is there an easier way to achive what i want?

Comments