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.
Having trouble with opExtrude on skText
jason_bennett190
Member, Developers Posts: 17 ✭
Hello,
I am trying to make 3D text via a Feature script, but having trouble with the "holes" being filled upon opExtrude.
How do I get ride of the extra material?
Thanks
Section of Code:
Results:
I am trying to make 3D text via a Feature script, but having trouble with the "holes" being filled upon opExtrude.
How do I get ride of the extra material?
Thanks
Section of Code:
<div>opPlane(context, id + "plane1", {</div><div> "plane" : plane(planeOrigin, planeNormal)</div><div> });</div><div> </div><div> var sketch1 = newSketch(context, id + "sketch1", {</div><div> "sketchPlane" : qCreatedBy(id + "plane1", EntityType.FACE)</div><div> });</div><div> </div><div> const textItem = skText(sketch1, "text1", {</div><div> "text":definition.label,</div><div> "fontName" : "OpenSans-Bold.ttf"</div><div> });</div><div> </div><div> skSolve(sketch1);</div><div> </div><div> </div><div> const textOrigin = vector(0*meter,0*meter,planeOrigin[2]);</div><div> const textMove = vector(minPoint[0]+textHeight,maxPoint[1]-2*textHeight,0*meter);</div><div><br></div><div> opTransform(context, id + "transform1", {</div><div> "bodies" : qCreatedBy(id + "sketch1", EntityType.BODY),</div><div> "transform" : transform(textMove)*scaleUniformly(textScale,textOrigin)</div><div> });</div><div> </div><div> opExtrude(context, id + "extrude1", {</div><div> "entities" : qCreatedBy(id + "sketch1", EntityType.FACE),</div><div> "direction" : planeNormal*-1,</div><div> "endBound" : BoundingType.BLIND,</div><div> "endDepth" : 3 * millimeter</div><div> });</div>
Results:
0
Comments
If there is no quick fix or minor thing that I am missing, I think I could build a sorting function. Maybe:
You want to use qSketchRegion() as a query that you pas to opExtrude, not to opPlane - just to make sure.
qSketchRegion also has an innerloop filter which may work -
qSketchRegion (featureId is Id, filterInnerLoops is boolean) returns Query
A query for all fully enclosed, 2D regions created by a sketch with the specified feature id.
filterInnerLoops
boolean
Optional
Specifies whether to exclude sketch regions fully contained in other sketch regions. Default is false.
As a work around, I wrote a filter to remove the internal regions, which is below.
I would still like to see a simpler solution.
Thanks for the feedback so far.
@NeilCooke
It looks like filterInnerLoops used to default to "true" in older versions of std, which is likely why you don't remember needing to specify the flag before.
Thanks!
Unfortunately, filterInnerLoops does not properly handle the case where there is more than one level of nested loops.
As an example, make a sketchText containing Unicode character 0x0298 (LATIN LETTER BILABIAL CLICK): ʘ (Use the Tinos font). This character is topologically equivalent to an "O" character with a dot in the middle of the "O". Extrude the sketch with filterInnerLoops, and in the resulting solid, you will see that the middle dot is missing.