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.
opLoft errors
konstantin_shiriazdanov
Member Posts: 1,221 ✭✭✭✭✭
I'm making feature which generates a number of cross sections, obtained from surface intersections, they are then appended to the list and passed to the opLoft. And I keep getting 2 types of errors in the console:
1) @opLoft: LOFT_SELECT_PROFILES in case when i simply pass a list of queries for generated profile wire bodies
2) @opLoft: LOFT_DIRECTION_ERROR in case when I pass for profileSubqueries evaluated query of qUnion for list of profile queries: "profileSubqueries" : evaluateQuery(context, qUnion(profiles))
But I should notice that in second case the opLoft worked as expected and made a surface in another test situation. The strangest thing is that I can still build a loft through my generated wires with builtin part studio feature with no errors.
Here is the feature: https://cad.onshape.com/documents/e0e6d57303f343d9a489112e/w/6aa4adcacac20a0b5016c188/e/eeeff94d3c1ff3b4f68b8be2
1) @opLoft: LOFT_SELECT_PROFILES in case when i simply pass a list of queries for generated profile wire bodies
2) @opLoft: LOFT_DIRECTION_ERROR in case when I pass for profileSubqueries evaluated query of qUnion for list of profile queries: "profileSubqueries" : evaluateQuery(context, qUnion(profiles))
But I should notice that in second case the opLoft worked as expected and made a surface in another test situation. The strangest thing is that I can still build a loft through my generated wires with builtin part studio feature with no errors.
Here is the feature: https://cad.onshape.com/documents/e0e6d57303f343d9a489112e/w/6aa4adcacac20a0b5016c188/e/eeeff94d3c1ff3b4f68b8be2
And test cases are in Part studio 0 and Part studio 1.
I have a suspicion that error @opLoft: LOFT_DIRECTION_ERROR only occurs for open contours
1
Comments
change line 93 to profiles = append(profiles, makeRobustQuery(context,qBodyType(qCreatedBy(id + ("crossSection" ~ i), EntityType.BODY),BodyType.WIRE);
I am wondering if the boolean is not resolving the entities for you. however, when I test this, it resolves fine.
I have to use makeRobustQuery sometimes when I am using Extend
calling qUnion(profiles) seems like it may order the entities wrong for you. I would avoid that if at all possible.
Another option would be to just use the evPathTransforms code in Path utils
https://cad.onshape.com/documents/f902670516b3542414e3ab98/v/a0af217573ceb4be567f23f0/e/81858a9ae2c1683847d4a5b0
Then, transform and copy the wire body extracted from the boolean intersection on line 86. this opBoolean on line 86 would only need to be executed once, then opPattern the results with the results from evPathTransforms.
When you do figure this out, please share. I often have loft issues that are hard to determine the culprit.
have you tried using loft instead of opLoft?
there are some things that loft will fix for you. I generally use loft unless its a simple loft.
I cannot see why this is failing to be honest. I would try loft instead of opLoft.
"bodyType" : ToolBodyType.SURFACE,
"wireProfilesArray" : profiles,
});
Precondition of replaceWireSubQueriesWithDependencies failed (query.subqueries is array)
LOFT_SELECT_PROFILES and LOFT_DIRECTION errors
to be honest, i didn't even know boolean intersection of 2 sheets generated curves. I normally use opSplitFace to get those curves. I have tested the boolean intersection on a face, and the result was actually 3 different edges which will really make a loft mad if you do not use guide curves.
"faceTargets" : qOwnedByBody(patternedBody,EntityType.FACE,
"planeTools" : planeFromEvPathTangentLines
});
var newEdges =qCreatedBy(id+"GetIntersectingEdges",EntityType.EDGE);
Unless you are using the same tool body to create all of the intersections, Is this what microstep does? I am interested to know why you cannot just use the plane from evPathTangentLines to split the sections? I assume you thought of this and the results are not quite correct?
Yes, I tryed opSplitByIsocline using tangent line as direction and even it's resulting cross sections are less accurate then what boolean selfintersection can give. Though I didn't faced any loft problems with these kind of cross sections.
you will need to take the tangentLines from evPathTangentLines. for every one, call
opPlane(context, id+"plane"+ i, {
"plane":plane(tangentLine.origin,tangentLine.normal)
});
now split the body faces with this plane.
opSplitFace(context, id+"GetIntersectingEdges",{
"faceTargets" : qOwnedByBody(patternedBody,EntityType.FACE,
"planeTools" : qCreatedBy(id+"plane"+i)
});
var newEdges =qCreatedBy(id+"GetIntersectingEdges",EntityType.EDGE);
plane tools will expand infinitely to ensure the split occurs.
interestingly enough, the transformation used for each body section, is also using the lines from evPathTangentLines.tangentLines so everything should match up perfectly.
So you may call pathPattern 2x and pass the tool once, and the plane body the second time.
They are just not as accurate from geometrical point compared to what boolean self intersection gives. Just beleve me, I know what I'm doing)
I believe you. I just tested one face with boolean intersection and the results would not be useable for a loft feature as there were 3 edges on one face, where opSplitFace would only give 1 edge. Then the second face i split had 1 edge which would kill a solid loft, a surface loft could be handled using trim sections and trim guides.
I have no idea why the loft fails. i would put in an AddDebugEntities, different colors for the first 5 sections to make sure you're actually passing what you want it to pass. again why this would even occur is beyond me.
I have found that opLoft is more successful if it follows the qConstructionFilter that you find in the Loft.fs code in function "wrapSubqueriesInConstructionFilter". If you add this to your profile query, it will work better.
The most robust loft that I have found, is using the onshape loft(context,id,definition). I can pass the same data to loft and opLoft, but opLoft will fail more than loft. If loft only had a way to select start and end tangent faces, then I could use loft more than opLoft, however for loft.fs, the tangent faces must be adjacent to the first and last sections which is not always possible for me. It is too bad that the general onshape loft feature will not allow us to specify the start faces and end faces as going through the opLoft seems to be highly prone to failures where loft is not. I have even replicated their code to create a more robust definition to pass to opLoft but still, for some odd reason, loft will succeed where opLoft does not.