Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Mirror for spline
quentin_mouty
Member, Developers Posts: 13 ✭
Hello,
I want to mirror a spline around a line in a sketch in a feature script.
I find the mirror function but I am not sure if it is the right function to do it and if so how to use it.
I tried this :
Thank for any help.
I want to mirror a spline around a line in a sketch in a feature script.
I find the mirror function but I am not sure if it is the right function to do it and if so how to use it.
I tried this :
mirror(context, id + "mirror1", {<br> "patternType" : MirrorType.FEATURE,<br> "entities" : "spline1",<br> "mirrorPlane" : "line1"<br> });Where spline1 and lin1 are :
skFitSpline(sketch1, "spline1", {<br> "points" : [<br> vector(X(0, rayon_base), Y(0, rayon_base)) * millimeter,<br> vector(X(0.1, rayon_base), Y(0.1, rayon_base)) * millimeter,<br> vector(X(0.2, rayon_base), Y(0.2, rayon_base)) * millimeter,<br> vector(X(0.3, rayon_base), Y(.3, rayon_base)) * millimeter,<br> vector(X(0.4, rayon_base), Y(0.4, rayon_base)) * millimeter,<br> vector(X(0.5, rayon_base), Y(0.5, rayon_base)) * millimeter,<br> vector(X(0.6, rayon_base), Y(0.6, rayon_base)) * millimeter,<br> vector(X(0.7, rayon_base), Y(0.7, rayon_base)) * millimeter,<br> vector(X(0.8, rayon_base), Y(0.8, rayon_base)) * millimeter,<br> vector(X(0.9, rayon_base), Y(0.9, rayon_base)) * millimeter<br> ]<br> });<br>skLineSegment(sketch1, "line1", {<br> "start" : vector(0,0) * millimeter,<br> "end" : vector(rayon/millimeter*cos(alpha*degree), rayon/millimeter*sin(alpha*degree)) * millimeter<br> });
Thank for any help.
0
Answers
Also, the mirror function needs to go after the other code.
Like this: Hopefully this helps.
Thank for your answer but I still have an error with mirror :