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.
Suppressing automatic filling of disjoint polylines and keeping sketches extrudeable
Paul_Arden
Posts: 228
I'm working on a little FeatureScript just as a learning exercise which generates a sketch based on the 10 PRINT routine. It's still rough but I am hitting a problem early on. Onshape is creating faces correctly for my closed polyline entities, however it is also creating additional faces if multiple polyline objects vertices join to form a face, despite the fact that these are separate entities. See this image:

The areas inside the diagonal boundaries should not be filled with a face. While when using Onshape outside FeatureScript I usually think of this as a nice feature, in this case I don't want that behaviour. Is there any way to suppress it?
It may or may not be related, however when I go to extrude the sketch that the feature generates it does not work selecting the entire feature at once. I have to select the individual faces one at a time. Doing the extrusion inside the FeatureScript fails as well if I try and query all entities on the sketch with qSketchRegion (commented out in the shared version below).
You can check out the Onshape document here. FeatureScript code is WIP, just looking to resolve these two issues first.

The areas inside the diagonal boundaries should not be filled with a face. While when using Onshape outside FeatureScript I usually think of this as a nice feature, in this case I don't want that behaviour. Is there any way to suppress it?
It may or may not be related, however when I go to extrude the sketch that the feature generates it does not work selecting the entire feature at once. I have to select the individual faces one at a time. Doing the extrusion inside the FeatureScript fails as well if I try and query all entities on the sketch with qSketchRegion (commented out in the shared version below).
You can check out the Onshape document here. FeatureScript code is WIP, just looking to resolve these two issues first.
Tagged:
0
Best Answers
-
Hi Paul, to prevent the areas filling, you could create a new sketch for each polyline inside one FeatureScript feature. Also, the reason you cannot extrude the entire feature after the fact is because it is not a sketch, it is a custom feature that created lines and faces. Can you create the extrude inside the feature?Senior Director, Technical Services, EMEA5
-
qCreatedBy(id, EntityType.FACE) will get you all faces within your feature, which should just be the faces created by the sketches.Senior Director, Technical Services, EMEA5
-
Not the coplanar faces, but the coincident edges which make a zero thickness edge. You may have to overlap them by a few microns.paul_arden said:I am guessing it might be due to the way the shapes are coplanar along some of their faces but not sure.Senior Director, Technical Services, EMEA5
Answers
-
Hi Paul, to prevent the areas filling, you could create a new sketch for each polyline inside one FeatureScript feature. Also, the reason you cannot extrude the entire feature after the fact is because it is not a sketch, it is a custom feature that created lines and faces. Can you create the extrude inside the feature?Senior Director, Technical Services, EMEA5
-
Using a sketch per item fixed the merging issue thanks. Just looking at the extrusion now, since I now have lots of sketches in the feature I am not sure what the correct query would be to get the regions for all of them rather than just one (I want to do a solid extrusion). I'm looking through the docs now but if I am missing something obvious...0
-
I have it working by making an array of qSketchRegion's then giving that to qUnion, however not sure if that is the most efficient mechanism. At least it is giving me the desired result.

0 -
qCreatedBy(id, EntityType.FACE) will get you all faces within your feature, which should just be the faces created by the sketches.Senior Director, Technical Services, EMEA5
-
Thanks, that's got it. I am not sure if it is related however I am now trying to subtract the solid generated from another solid and I am getting a BOOLEAN_INVALID error thrown. This only seems to happen for certain numbers of elements (the features takes a length and width which is the number of those little elements it will make). It may be it should end up in another thread but this is a version of the document which has the invalid boolean regeneration error:
https://cad.onshape.com/documents/9cd2a1622fc9ce8d26314a16/v/a80f215aca690e8886c06784/e/c47d5f43eb33e8799630d20a
It has been shared with support also. I am guessing it might be due to the way the shapes are coplanar along some of their faces but not sure.0 -
Making an individual sketch for each hex thing is probably more expensive than necessary. If you want a query for all the faces at once, in your specific case, since the faces are all the same size, using qSmallest should work (it returns all the smallest faces). There might be some other cleverness, but an alternative is also using an opPattern.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0
-
Not the coplanar faces, but the coincident edges which make a zero thickness edge. You may have to overlap them by a few microns.paul_arden said:I am guessing it might be due to the way the shapes are coplanar along some of their faces but not sure.Senior Director, Technical Services, EMEA5 -
Thanks, I added an expansion factor of 10 micrometers (much smaller didn't seem to work) around the edges. I will have a play and see if I can push it lower but that definitely worked. So now I have my 10 PRINT coaster ready for slicing and 3D printing.

1 -
Parasolid has a Boolean tolerance of 10 microns so that's the lowest you can go. You've got better eyesight than me if you can tell the difference!
Senior Director, Technical Services, EMEA0

