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.

"Un-split" (merge?) coplanar surface made of several faces?

eric_pestyeric_pesty Member Posts: 1,881 PRO
It seems like this should be simple enough but can't seem to find an easy to way to do this.

Basically I want to get rid of "splits" in a planar surface made of multiple faces.
An example would be if you use the slot tool on a chain of sketch entities and then create an offset surface from it you end up with a single surface but that is split into different faces where the different sketch regions where.

It's just one planar face so there is no "need" for these splits... What's the best way to get to a single face from here?


Comments

  • glen_dewsburyglen_dewsbury Member Posts: 778 ✭✭✭✭
    I try to avoid trimming sketches unless needed. In this case trimming got rid of the extra line work in an offset face.


  • eric_pestyeric_pesty Member Posts: 1,881 PRO
    edited May 31
    I'm dealing with a more "generalized" case so manually trimming sketches is not an option...

    It looks there's a way to do it in FS but it seems odd that I'd need a custom feature for this!

    <div>        opExtractSurface(context, id + "offsetFace1", {
                    "faces" : definition.face,
                    "redundancyType" : "REMOVE_ALL_REDUNDANCY"
            });<br></div>
  • _anton_anton Member, Onshape Employees Posts: 410
    edited May 31
    Well, it's a hack, but you could extrude and then delete everything but the cap face. Edit: or extract the surfaces individually and then boolean them together.
  • eric_pestyeric_pesty Member Posts: 1,881 PRO
    edited May 31
    _anton said:
    Well, it's a hack, but you could extrude and then delete everything but the cap face. Edit: or extract the surfaces individually and then boolean them together.
    Yeah, that's one manual way of doing it and where I started...

    I ended up creating an "Unsplit" FS that does the job (and also creates a composite of the whole thing), pretty simple using  "REMOVE_ALL_REDUNDANCY" option from opExtractSurface:

    FeatureScript 2368;
    import(path : "onshape/std/common.fs", version : "2368.0");
    
    annotation { "Feature Type Name" : "Unsplit Faces" }
    export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)
        precondition
        {
            // Define the parameters of the feature type
            annotation { "Name" : "Faces", "Filter" : (EntityType.BODY&&BodyType.SHEET || EntityType.FACE) }
            definition.faces is Query;
            
            annotation { "Name" : "Create Composite?", "Default" : true}
            definition.composite is boolean;
            
    
        }
        {
            // Define the function's action
    
            var bodyFaces = qOwnedByBody(definition.faces, EntityType.FACE);
            var faces = qEntityFilter(definition.faces, EntityType.FACE);
    
            opExtractSurface(context, id + "offsetFace1", {
                        "faces" : qUnion([bodyFaces, faces]),
                        //"tangentPropagation":true,
                        "redundancyType" : "REMOVE_ALL_REDUNDANCY"
                    });
            try
            {
                opDeleteBodies(context, id + "deleteBodies1", {
                            "entities" : qEntityFilter(definition.faces, EntityType.BODY)
                        });
            }
            
            if (definition.composite)
            {
                opCreateCompositePart(context, id + "compositePart1", {
                        "bodies" : qCreatedBy(id + "offsetFace1", EntityType.BODY),
                        "closed" : true
                });
            }
    
        });

    I also created and IR to add this to the standard offset surface:
    https://forum.onshape.com/discussion/24214/add-option-to-merge-un-split-faces-in-offset-face#latest
  • S1monS1mon Member Posts: 2,980 PRO
    Interesting. Plasticity (also Parasolid based) has a command to "Delete Redundant Topology". It will remove any splits from faces which could be the same face, including curved faces. I wonder if there is the equivalent low level tool in FeatureScript? I found options in opMoveFace and opOffsetFace.


  • eric_pestyeric_pesty Member Posts: 1,881 PRO
    S1mon said:
    Interesting. Plasticity (also Parasolid based) has a command to "Delete Redundant Topology". It will remove any splits from faces which could be the same face, including curved faces. I wonder if there is the equivalent low level tool in FeatureScript? I found options in opMoveFace and opOffsetFace.


    Interestingly, the opMoveFace wasn't helping in this case...

    The code above does work on curved faces, it doesn't work on solids directly (I wasn't trying for that...) but if it can create a single face from selecting split faces of the solid and then you can do a "Replace face". Not really needed as a "Delete face" with "heal" normally does the job (but not on a surface).
Sign In or Register to comment.