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.
Can I create sketch conics with Featurescript?
EvanReese
Member, Mentor Posts: 2,135 ✭✭✭✭✭
I expected it to be as easy as skConic but I'm not seeing the option in the documentation. Is it hidden somewhere or not possible for some reason?
Evan Reese
0
Best Answer
-
mahir Member, Developers Posts: 1,307 ✭✭✭✭✭@Evan_Reese, I found this in the std source. Might be what you already found, but just in case...
* Creates a conic section with the given rho value through the start and end points using the control point. * If x is the distance between controlPoint and the line between start and end, and y is the maximum distance between * the conic section and the same line, then rho is x/y. * @param sketch : @autocomplete `sketch1` * @param conicId : @autocomplete `"conic1"` * @param value {{ * @field start {Vector} : * @eg `vector(0, 0) * inch` * @field controlPoint {Vector} : * @eg `vector(0.5, 0.5) * inch` * @field end {Vector} : * @eg `vector(1, 0) * inch` * @field rho {number} : 0 < rho < 0.5 => elliptical arc, rho = 0.5 => parabola, 0.5 < rho < 1 => hyperbola * @eg `0.5` * @field lowParameter {number} : starting parameter of the segment @optional * @field highParameter {number} : ending parameter of the segment @optional * @field construction {boolean} : `true` for a construction conic @optional * @field fixedRho {boolean} : `true` to fix rho during sketch solve @optional * }} */ export function skConicSegment(sketch is Sketch, conicId is string, value is map) precondition { value.start is undefined || is2dPoint(value.start); value.end is undefined || is2dPoint(value.end); value.controlPoint is undefined || is2dPoint(value.controlPoint); value.rho is undefined || value.rho is number; value.lowParameter is undefined || value.lowParameter is number; value.highParameter is undefined || value.highParameter is number; value.construction is undefined || value.construction is boolean; value.fixedRho is undefined || value.fixedRho is boolean; } { return @skConicSegment(sketch, conicId, value); }
2
Answers
I had not looked there so thanks for double-checking. I'm still not the best at knowing where to check for this stuff I guess. That got it working for me as expected