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.

opIntersectFaces curves don't create extrudable region

barry_foustbarry_foust Member Posts: 6

I'm trying to write a FeatureScript that takes a part in the shape of a wing dissected by an array of planes. The intersection of the wing at each plane is then extruded to create a series of ribs. The curves that I get from opIntersectFaces aren't in the sketch I create, and the curves don't form a region that can be extruded. Here is what I have so far:

https://cad.onshape.com/documents/9303fb86fa91de5af31b14a6/w/c1a4f814459ac83e9bdeb89e/e/7147c8b08dd81f056f656a6c?renderMode=0&uiState=68d134fd343ea5ede30ae77a

Comments

  • GregBrownGregBrown Member, Onshape Employees, csevp, pcbaevp Posts: 353 image

    The way I've always done this is to get the intersecting curves, then make a fill surface from them, and thicken this surface. It saves messing around with sketches. I also think it is easier to do it for a single intersection, then use feature patterning to to the other ribs…

  • barry_foustbarry_foust Member Posts: 6

    Thanks, You lead me down the right path. Here is what I ended up with…

            // Define the function's action
            const allFaces = evaluateQuery(context, definition.faces);
            var i = 0;
            // for each plane
            for (var face in allFaces)
            {
                i += 1;
    
                // Intersect with the wingBody
                const bodyFaces = qOwnedByBody(definition.wingBody, EntityType.FACE);
    
                const curve = opIntersectFaces(context, id + (i ~ "intersect"), {
                            "tools" : bodyFaces,
                            "targets" : face
                        });
    
                opFillSurface(context, id + (i ~ "fillSurface"), {
                            "edgesG0" : qCreatedBy(id + (i ~ "intersect"), EntityType.EDGE)
                        });
    
                var plane = evPlane(context, {
                        "face" : face
                    });
    
                var extrudeFace = qCreatedBy(id + (i ~ "fillSurface"), EntityType.FACE);
    
                opExtrude(context, id + (i ~ "extrude"), {
                            "entities" : extrudeFace,
                            "endBound" : BoundingType.BLIND,
                            "endDepth" : definition.ribWidth * inch,
                            "direction" : plane.normal
                        });
            }
    
Sign In or Register to comment.