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.
Problem with opLoft and qUnion([qNthElement(......query
tonvis
Member Posts: 41 ✭✭
Can someone of the team please help me out ?
Working on a Bevelgear FS combining Neil Cooke's Spurgear and ika Hölsö's FS , I got problems with opLoft to use two teethprofiles as edgequeries from qUnion([qNthElement( .......
Lofting whole sketches is no problem but I just need a cut-outpart of the sketches:
/* 687
var vertrices = qUnion([outer_modul, inner_modul]);
var profileSubqueries = [qCreatedBy(id + "sketch5"), qCreatedBy(id + "sketch6")];
opLoft(context, id + "loft1", { //@opLoft: LOFT_VERTEX_ADDITIONS error
"profileSubqueries" : profileSubqueries,
"vertrices" : vertrices
});
*/
var profileSubqueries = [qCreatedBy(id + "sketch5"), qCreatedBy(id + "sketch6")];
opLoft(context, id + "loft1", { //@opLoft: LOFT_VERTEX_ADDITIONS error
"profileSubqueries" : profileSubqueries,
"vertrices" : vertrices
});
*/
I has tried everything. It may be very simple but I can't find a solution.
When working in partstudio it is no problem to loft the both faces.
May thanks for your help
tonvis
0
Best Answer
-
tonvis Member Posts: 41 ✭✭I found the answer//******************************forming teeth *********************************************tonvis
/** to get the teeth_faces out of all other faces, this is the right way to do it
* use qSketchRegion(id) and qUnion([qNthElement(faces, n)])
* I was using edges first, but that was the wrong way of doing
* with no result
* */
// -----------------solves all the faces to select from --------------------------
var faces = qUnion([qSketchRegion(id + "sketch5"), qSketchRegion(id + "sketch6")]);
//debug(context, faces); //debug: Query resolves to 2x6 faces
// ----------------- get the teeth_faces out of 6 faces -------------------------------
//var faceQuery0 = qUnion([qNthElement(faces, 0)]);
var faceQuery1 = qUnion([qNthElement(faces, 1)]); //2 x onder
//var faceQuery2 = qUnion([qNthElement(faces, 2)]);
//var faceQuery3 = qUnion([qNthElement(faces, 3)]);
var faceQuery4 = qUnion([qNthElement(faces, 4)]); //2 x boven
//var faceQuery5 = qUnion([qNthElement(faces, 5)]);
//debug(context, faceQuery1);
//debug(context, faceQuery4);
/** no problem for loft any longer ! it was really hard to find the solution */
opLoft(context, id + "loft1", {
"profileSubqueries" : [faceQuery1, faceQuery4]
});
1
Answers
Sketches have edges, faces, vertices, bodies - which ones are you lofting?
opDeleteBodies(context, id + "deleteBodies1", {
"entities" : delete_edges
});
edgeQuery_5,
edgeQuery_6,
edgeQuery_8,
edgeQuery_10
]);
edgeQuery_16,
edgeQuery_19,
edgeQuery_21
]);
They won't listen to me !
/** to get the teeth_faces out of all other faces, this is the right way to do it
* use qSketchRegion(id) and qUnion([qNthElement(faces, n)])
* I was using edges first, but that was the wrong way of doing
* with no result
* */
// -----------------solves all the faces to select from --------------------------
var faces = qUnion([qSketchRegion(id + "sketch5"), qSketchRegion(id + "sketch6")]);
//debug(context, faces); //debug: Query resolves to 2x6 faces
// ----------------- get the teeth_faces out of 6 faces -------------------------------
//var faceQuery0 = qUnion([qNthElement(faces, 0)]);
var faceQuery1 = qUnion([qNthElement(faces, 1)]); //2 x onder
//var faceQuery2 = qUnion([qNthElement(faces, 2)]);
//var faceQuery3 = qUnion([qNthElement(faces, 3)]);
var faceQuery4 = qUnion([qNthElement(faces, 4)]); //2 x boven
//var faceQuery5 = qUnion([qNthElement(faces, 5)]);
//debug(context, faceQuery1);
//debug(context, faceQuery4);
/** no problem for loft any longer ! it was really hard to find the solution */
opLoft(context, id + "loft1", {
"profileSubqueries" : [faceQuery1, faceQuery4]
});
It's not really a great idea to rely on qNthElement().
What I would do instead is something specific like:
Replacing the position with an actual position that you know exists on that sketch face.