Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:

  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

What does NO_ERROR mean?

kendall_freykendall_frey Member Posts: 2
I'm trying to use skEllipticalArc in a feature, but every time I give it a center that is not the origin (0,0) it produces NO_ERROR and doesn't create the arc.



Here is the simplest code that reproduces it:
FeatureScript 581;import(path : "onshape/std/geometry.fs", version : "581.0");
annotation { "Feature Type Name" : "Test" }export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)    precondition    {        // Define the parameters of the feature type    }    {        var sketch1 = newSketch(context, id + "sketch1", {                "sketchPlane" : qCreatedBy(makeId("Top"), EntityType.FACE)        });        skEllipticalArc(sketch1, "ellipticalArc1", {                "center" : vector(2, 0) * inch,                "majorAxis" : vector(1, 0) * inch,                "minorRadius" : 1 * inch,                "majorRadius" : 2 * inch,                "startParameter" : 0,                "endParameter" : 0.25        });        skSolve(sketch1);            });
Is this a bug? How can I create an arc where the center is somewhere other than the origin?

Answers

  • emmett_weeksemmett_weeks Onshape Employees Posts: 26
    edited May 2017
    It turns out that this is a bug. When sketching interactively, none of the arguments to skEllipticalArc are used, so I never noticed that one of them doesn't work properly. As a temporary workaround, it's possible to use skSetInitialGuess. skSetInitialGuess takes in a sketch and a map of sketch entity ids to arrays. This is used to place those entities in the sketch. Using it would look something like this.
            var sketch = newSketch(context, id + "sketch1", {
                    "sketchPlane" : qCreatedBy(makeId("Top"), EntityType.FACE)
                });
                
            const initialGuess = { "ellipticalArc" : [2, 0, sqrt(2) / 2, sqrt(2) / 2, 1, 0.5, 0, 3] };
                
            skEllipticalArc(sketch, "ellipticalArc", { });
            
            skSetInitialGuess(sketch, initialGuess);
            skSolve(sketch);
    The initial guess data for an elliptical arc is in this format: [center x, center y, major axis x, major axis y, major radius, minor radius, start parameter, end parameter] All distances are in meters, the parameter's domain is [0, 2 pi], and the major axis will not be normalized for you unlike with the skEllipticalArc function.
  • john_f_carrjohn_f_carr Onshape Employees Posts: 74
    The fix for this went out in our last update.  Like many fixes, it only affects new and upgraded Part Studios.
Sign In or Register to comment.