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.

loft not working with guides ;-;

eitan_goldshtromeitan_goldshtrom Member Posts: 6 ✭✭
https://cad.onshape.com/documents/4415e93291eabbf9ee253eec/w/27d3564434c2b91b92bfdf5b/e/51a511cfa043954a4e85962d

i am working on a keyboard frame and need to perform a complex loft. in this previous discussion thread i asked how to fix the connections in my loft, and got the answer i needed. however, i wanted to try and find a way to remove some of the manual shenanigans involved, so decided to try building a feature to line everything up for me. i eventually got things mostly working, as seen here:

however, the curvature is wrong, which i created guides to help with. i know i don't strictly need guides for this, but it gives me an amount of control i want over the precise curve. unfortunately, it will not generate when i include the guides. here you can see the guides in debug red, and you see that the loft didn't generate:


i have tried using opLoft as:
opLoft(context, id + "loft1", {
            "bodyType" : ToolBodyType.SOLID,
            "profileSubqueries" : [definition.startProfiles, definition.endFace],
            "connections" : connections,
            "guideSubqueries" : evaluateQuery(context, qCreatedBy(id + "bridge1", EntityType.EDGE)),
            "derivativeInfo" : [
                { "profileIndex" : 0, "matchCurvature" : false, "forGuide": false, "adjacentFaces" : qSubtraction(qAdjacent(definition.startProfiles, AdjacencyType.VERTEX, EntityType.FACE), definition.startProfiles) },
                { "profileIndex" : 1, "matchCurvature" : false, "forGuide": false, "adjacentFaces" : qSubtraction(qAdjacent(definition.endFace, AdjacencyType.EDGE, EntityType.FACE), definition.endFace) },
            ],
        });

and using loft, when opLoft didn't work:

loft(context, id + "loft1", {
            "bodyType" : ExtendedToolBodyType.SOLID,
            "sheetProfilesArray" : [
                { "sheetProfileEntities" : definition.startProfiles },
                { "sheetProfileEntities" : definition.endFace },
            ],

            "startCondition" : LoftEndDerivativeType.MATCH_TANGENT,
            "adjacentFacesStart" : qSubtraction(qAdjacent(definition.startProfiles, AdjacencyType.VERTEX, EntityType.FACE), definition.startProfiles),
            "startMagnitude" : 1,

            "endCondition" : LoftEndDerivativeType.MATCH_TANGENT,
            "adjacentFacesEnd" : qSubtraction(qAdjacent(definition.endFace, AdjacencyType.EDGE, EntityType.FACE), definition.endFace),
            "endMagnitude" : 1,

            "addGuides" : true,
            "guidesArray" : guides,

            "matchConnections" : true,
            "connections" : connections,
        });
opLoft results in the error "LOFT_START_OR_END_CONDITIONS_WITH_GUIDES_FAILED", while loft results in the error "LOFT_NO_FACE_FOR_GUIDE_CLAMP". since i only have access to the loft code, i can't figure out what opLoft doesn't like. but i also could not get things set up for loft to stop complaining about that >:T.

Best Answer

  • eitan_goldshtromeitan_goldshtrom Member Posts: 6 ✭✭
    Answer ✓
    false alarm. turns out this isn't an issue with featurescript, but with my guides.

    i did some more digging and discovered that this doesn't even work with a manual loft feature (no scripting) because of some of the guides. when i remove those guides from my feature script, it works >_<. i had neglected to sufficiently test the manual approach, because of some initial manual success with the guides. but this only appeared when many guides were included simultaneously.

Answers

  • eitan_goldshtromeitan_goldshtrom Member Posts: 6 ✭✭
    Answer ✓
    false alarm. turns out this isn't an issue with featurescript, but with my guides.

    i did some more digging and discovered that this doesn't even work with a manual loft feature (no scripting) because of some of the guides. when i remove those guides from my feature script, it works >_<. i had neglected to sufficiently test the manual approach, because of some initial manual success with the guides. but this only appeared when many guides were included simultaneously.
Sign In or Register to comment.