Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

How do you get faces cut out by opSplitFace

dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭

Suppose I start with a face, like definition.someFace.  I have found that if I do this:

            opSplitFace(context, splitFaceId, {
                    "faceTargets" : definition.someFace,                
                    "edgeTools": edgeTools,
                    "direction": surfaceTangentPlane.normal
            }); debug(context, qCreatedBy(splitFaceId, EntityType.FACE) );

qCreatedBy(splitFaceId) does not return any results. 

What I expected to get was the faces that were stamped out by the cutting tool.

Instead, after opSplitFace, I find that definition.someFace now returns all of the faces.  qNthElement(definition.someFace,0) returns indeterministic results.

What I want to get is a reference to the faces that were 'cut out' by the edges. But I cannot find out a good way to do that.

Any suggestions?

Answers

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    Would taking the edges of definition.someFace before the split, and subtracting the faces edge-adjacent to those edges after the split from the set of all faces do the right thing?  Something like (untested code, beware):

    var edges = qUnion(evaluateQuery(context, qEdgeAdjacent(definition.someFace, EntityType.EDGE)));
    // Now do the split here
    var stampedFaces = qSubtraction(qCreatedBy(splitFaceId, EntityType.FACE), qEdgeAdjacent(edges, EntityType.FACE));


    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    Thanks thats a good direction I'll try something along those lines. 

    I also tried qDependency hoping that the stamped out faces woudl be a dependency of the original edges, but that did not work.


  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    Oh, wait-- that doesn't work, because qCreatedBy(splitFaceId, EntityType.FACE) does not return any results.... It appears to be one of those operations like opTransform that just modifies the original queries, rather than populating its own results.


  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    You are right, I think -- then using definition.someFace after the split instead of qCreatedBy(splitFaceId, EntityType.FACE) should work.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
Sign In or Register to comment.