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.


Help Point for Split in FeatureScript?

jelte_steur814jelte_steur814 Member Posts: 77 PRO
edited March 20 in FeatureScript
I'm working on an alternative split body feature that first creates a copy of the part and splits both of those so attributes/properties and ID's are more stable in referencing their part (original or new).
This is relevant for 'keep both sides' splits. I've often had a upstream feature of the split tool change direction and therefore the split parts changing identity. then there's no way of repairing that easily.

in the split curve feature, there's a neat 'Help point' that can be used to indicate what side of the split tool is meant to be used. this makes it even less stable to upstream changes in the split tool definition.
However that HelpPoint is fed into 'opMoveCurveBoundary.fs' so i cannot see how it's working. 'opSplitPart' doesn't allow this argument. Is there a way to create such a HelpPoint? I guess more specifically: how to evaluate the position of a HelpPoint with respect to a split tool?

Here's the first version without Help Point. can be repaired by reversing direction if it flips.



  • Options
    jelte_steur814jelte_steur814 Member Posts: 77 PRO
    FYI @Jason_S: We've discussed a feature like this in a support ticket a while ago. i finally got around learning Featurescript and building it.

  • Options
    Konst_ShKonst_Sh Member Posts: 41 PRO
    My guess is that splitting at least partially relies on the normal direction of tool surface or faces to define the identity of child bodies, so if your goal is splitting disambiguation you can try using this function from onshape std:
     * Reverses the orientation of sheet bodies.
     * @param id : @autocomplete `id + "flipOrientation"`
     * @param definition {{
     *   @field bodies {Query} : Sheet bodies whose orientation should be flipped.
     * }}
    export const opFlipOrientation = function(context is Context, id is Id, definition is map)
        return @opFlipOrientation(context, id, definition);

    In this sense the reference point can be used to define the correct side of surface normal, when you picking the point and using it to detect if it is located on the positive side of normal or not and if it is on the negative side you flipping the tool surface normal
  • Options
    S1monS1mon Member Posts: 2,359 PRO
    I run into body ID issues all the time in my typical workflows. Mostly it's stuff that I can control if I'm careful - keeping the order of surfaces in a merge correct, or the order of bodies in a boolean. However there are some things like Thicken or stuff like deleting a face, converting a solid to a surface and then Enclosing or Boolean adding a surf to create a solid again where the IDs are changed. As you've found Split can cause a lot of issues.

    In the past I saw something where someone mentioned using some dummy parts early in their feature tree that would carry the ID. I think the idea was you make a simple block, give it a name, etc, and then Boolean add to it at the end to give the intended ID to whatever body. I can't find the post right now, but there really needs to be a better way where by IDs are managed. I spend far too much time renaming parts in part studios, and then replacing parts in assemblies, and fixing mates in assemblies. It feels like there should be a more direct way of keeping a list of the intended parts list for a part studio, and then I'm ok manually saying that this meta data from this table is connected to this body in the studio, but I don't want to manually retype names, etc....

  • Options
    jelte_steur814jelte_steur814 Member Posts: 77 PRO
    Thanks @Konst_Sh
    that would help and be cleaner than of flipping the front/back of the splits.
    but how would one go about whether the reference point is on the positive side of the tool?
  • Options
    Konst_ShKonst_Sh Member Posts: 41 PRO
    but how would one go about whether the reference point is on the positive side of the tool?
    For that you will be able to flip the normal of the tool surface if the reference point is on the negative side

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,175
    I was recently doing some work in this direction -- it's not fully productized, but the code may be useful.  https://cad.onshape.com/documents/3ddaebb626065ce19bb3ea76/w/4f0a4aed4dc7038a26c85e52/e/22d578c2ef5a0beac0d3dc51  See also here: https://forum.onshape.com/discussion/23021/new-feature-split-with-flip
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
Sign In or Register to comment.