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.
Splitting a wing into ribs on iterations.
darren_13
Member, Developers Posts: 119 PRO
Im not getting any errors but also not getting any results, the idea is to split a wing into ribs and delete the bits in between, however user can specify rib number and thickness etc...
var halfrib=Ribthick/2;
for (var i = intervals; i < Length; i += intervals)//outerloop for each rib
{
for (var j = -1; j == 1; j += 2)//inner loop for either side of rib
{
cPlane(context, id + i + j + "cplane1", {
"entities" : qUnion(qCreatedBy(definition.selectPlane,EntityType.FACE)),
"cplaneType" : CPlaneType.OFFSET,
"offset" : (i+j*halfrib)*meter,
"angle" : 0.0 * degree,
"oppositeDirection" : false,
"flipAlignment" : false,
"width" : 0.15 * meter,
"height" : 0.15 * meter });
splitPart(context, id + i + j + "split1", {
"splitType" : SplitType.PART,
"targets" : qUnion(qCreatedBy(id + "Loft1", EntityType.BODY)),
"tool" : id + i + j + "cplane1",
"keepTools" : false,
"faceTargets" : qUnion([]),
"faceTools" : qUnion([]) });
}
}
Is there a code error or is it possible the plane isn't intersecting the wing?
Tagged:
0
Comments
something like:
plane1=plane(normal*i+j*halfrib,normal)
qunion(qcreatedby(plane1, EntityType.FACE) but plane1 wouldn't change name on each iteration?
code now reads:
I really do appreciate the help, Darren.
For each gap between the ribs, generate a rectangular prism that touches each rib face, and is longer than the wing an at least through the full thickness. Then, in a single boolean subtraction, choose all of these prisms as your tools, and the wing as the target. Similar code is in the Box Joint or Laser Joint examples in the community showcase.
PhD, Mechanical Engineering, Stanford University