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.
Sweep failed
tonvis
Member Posts: 41 ✭✭
Please can someone help me out.
I constructed in mine opinion a good path and a good profile to sweep.
but this has not been accepted by opSweep. I am trying everything for days without succes.
There must be a simple solution for it, but Ican't find it.
Many thanks for any help.
0
Best Answer
-
tonvis Member Posts: 41 ✭✭Hi Owen,Thanks for your comments, I have the modifications done/** ************************************ @OwenSparks comments *********************************************
*
* */
var spring_eyes = qUnion([
qCreatedBy(id + "sweep5", EntityType.BODY),
qCreatedBy(id + "sweep6", EntityType.BODY),
qCreatedBy(id + "sweep7", EntityType.BODY)
]);
// debug(context, spring_eyes); // Query resolves to 3 bodies
opBoolean(context, id + "boolean1", {
"tools" : spring_eyes,
"operationType" : BooleanOperationType.UNION
});
/** result: assembly still has 3 individual parts -> need to group !
* using "operationType" : NewBodyOperationType.ADD, in opSweep is not doing as expected
* making one part
*/
/*
opDeleteBodies(context, id + "deleteBodies3", {
// "entities" : sketchEntityQuery(id + "sketch5", EntityType.EDGE, "cylinder1")
"entities" : qCreatedBy(id + "sketch5", EntityType.BODY)
});
*/
/** opDeleteBodies 3 - why giving failure : @opDeleteBodies: DELETE_SELECT_PARTS ?
* better not to make sketch5 at line 266 , because it seems unnecessay for the helix.
* this part will not anylonger been created
*/
Regardstonvis
0
Answers
I believe the issue you are running into is that there is a large discontinuity of curvature between the helix and the eye bends. While you are using a circle as the profile and orientation shouldn't matter, circles are periodic with an internal beginning/end. Sweep will try to make the circular surface continuous and at that point will twist nearly 90 degrees (most likely) causing self-intersections in the surface. If you were to use something less symmetric, like a rectangle, you'd see how the profile twists as it goes along the curve.
If you segment the spring into three separate sections, using the end-caps of the previous sweep, the orientation will restart with each sweep and be able to be stitched up with a boolean. I've highlighted the 2nd sweep I used to help differentiate the three parts.
Also I thanks all members of the support team, who had assist me on various problems.
The composite curve doesn't actually do anything except group individual edges into a wire body. It will not change the geometry, or the outcome of the operation. It just makes the selection of the path easier, but in Jake's example, you would have the same result in the part studio if no composite curve was made, and you just selected all the edges in order. In FeatureScript, you just need to pass all the edges you want to sweep over as the `path`. As long as you make the geometric change that Jake mentions, it should work.
// ---------------- remove crossing wires --------------------------------------------------
opDeleteBodies(context, id + "deleteBodies1", {
"entities" : sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset2")
});
opDeleteBodies(context, id + "deleteBodies2", {
"entities" : sketchEntityQuery(id + "sketch7", EntityType.EDGE, "offset1")
});
//----------------- get all edges from flat spiral with fillets -----------------------------------
var flatPath = qLoopEdges(path2);
//debug(context, flatPath); //Query resolves to 16 edges
// ------------ obtain edges for curve1 -------------------------------------------------------------
var edgeQuery_1 = sketchEntityQuery(id + "sketch7", EntityType.EDGE, "arc2"); //Query resolves to 1 edges --- arc2
var edgeQuery_2 = qUnion([qNthElement(flatPath, 10)]); //Query resolves to 1 edges----- offset2 part
var edgeQuery_3 = qUnion([qNthElement(flatPath, 14)]); //Query resolves to 1 edges----- fillet
// --------------------------------- get curve1 for body of spring ---------------------------------
var curve1 = compositeCurve(context, id + "curve1", {
"edges" : qUnion([
edgeQuery_1,
edgeQuery_2,
edgeQuery_3
])
});
debug(context, curve1); // debug: undefined
// ---------------------------------- get the face for sweep -------------------------------------------
const sketch8 = newSketchOnPlane(context, id + "sketch8", {
"sketchPlane" : plane(vector(0 * mm, 0 * mm, offset_top), vector(0, 0, 1) * mm, vector(1, 0, 0) * mm)
});
const cirkel5 = skCircle(sketch8, "circle5", {
"center" : vector(-radi, 0 * mm),
"radius" : d / 2
});
skSolve(sketch8);
// ---------------------------------------- sweep for curve1 ------------------------------------------------
opSweep(context, id + "sweep5", { // @opSweep: SWEEP_SELECT_PATH
"bodytype" : ToolBodyType.SOLID,
"operationType" : NewBodyOperationType.NEW,
"profiles" : qCreatedBy(id + "sketch8", EntityType.FACE),
"path" : curve1
});
HWM-Water Ltd
*
* */
var spring_eyes = qUnion([
qCreatedBy(id + "sweep5", EntityType.BODY),
qCreatedBy(id + "sweep6", EntityType.BODY),
qCreatedBy(id + "sweep7", EntityType.BODY)
]);
// debug(context, spring_eyes); // Query resolves to 3 bodies
opBoolean(context, id + "boolean1", {
"tools" : spring_eyes,
"operationType" : BooleanOperationType.UNION
});
/** result: assembly still has 3 individual parts -> need to group !
* using "operationType" : NewBodyOperationType.ADD, in opSweep is not doing as expected
* making one part
*/
/*
opDeleteBodies(context, id + "deleteBodies3", {
// "entities" : sketchEntityQuery(id + "sketch5", EntityType.EDGE, "cylinder1")
"entities" : qCreatedBy(id + "sketch5", EntityType.BODY)
});
*/
/** opDeleteBodies 3 - why giving failure : @opDeleteBodies: DELETE_SELECT_PARTS ?
* better not to make sketch5 at line 266 , because it seems unnecessay for the helix.
* this part will not anylonger been created
*/
Regards