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.

Thicken in certain direction

MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
I would like to be able to thicken a face so that the thicken direction at the edges = cross(MYVECTOR, cross(MYVECTOR, surfaceNormal))
I would still like to have the thicken amount directly out from the face though.
@lougallo ?
mb - draughtsman - also FS author: View FeatureScripts
IR for AS/NZS 1100

Best Answer

«1

Answers

  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    Cross at edges for direction? Isn't that what thicken does?

    Are you looking for an extrusion? Couldn't you copy the surface and create the joining surfaces, then enclose to make a solid? 






  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    I am looking for someting like this. (It doesn't work that well)
    https://cad.onshape.com/documents/d17d93235d69e6ec8f815b80
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    Ok, it seems easy enough. The offset direction is based on the connecting sheet?

    Is this true?

  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    It shouldn't be.

    The direction of the edges should be perpendicular to the axis selected
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    was thinking this, but it didn't work:


    Not sure what you're crossing. Cross axis to what?  I guess this is your question. 


  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    How about this?

    cross these:


    to get a normal (I think this is what you have):


    I think you need another cross, cross these:


    to get this, is this the direction you're looking for?:


    you'll need 2 crosses to get the direction. I think.



  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    Yes,
    that is currently what my FeatureScript tries to do :)
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    edited December 2018
    When you're done with that, and you're looking for the next FS, could you please look into this. There's one thing that OS won't do, and it's the only thing that I can think of that I need. I'm dreading the day when I really need it and it's not there. It's a ruled surface. I use it a lot in SW and trying to mimic it is something I'm not sure I could do. This FS that you are currently writing is very close to a ruled surface generator.

    Pick an edge and enter a length:


    Ruled surface normal @ a distance:


    I use this pattern so much and I worry that I'm going to get caught one of these days. The full FS should ask for tangent or normal and possibly an angle with tangent being 0 and normal being 90 degrees. 

    I'm being asked a lot about surfacing inside OS, and honestly, I have no hesitation when designing with surfaces inside OS. This is a pattern that I use a lot, and with some trickery, I can approx. it, but it takes a lot of work and I don't like approx'ing.

    It seems like you're controlling direction at a surface's edge, and then building a surface with a certain magnitude would be easy?


  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    That ruled surface normal that you showed, did you use thicken then offset face?
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    edited December 2018 Answer ✓
    @billy2

    Ruled Surface FS:
    https://cad.onshape.com/documents/d17d93235d69e6ec8f815b80

    Sometimes works unpredictably for some edges.
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    I offset a surface, then lofted, then hid the top loft surface to make it look correct. You can't always do this and it's a long ways to creating a ruled surface. I'm not even sure it's correct.



    Let me dig through your code and see what's going on. I thought there would be an edge selector and then: normal, tangent.

    I'm not sure what "Direction" is doing.

    Do you mind me poking through your code?




  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    I believe the direction is a derivative of the surface at it's edge. I'll see if this is available in feature script.

    Direction shouldn't be constant.
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    edited December 2018
    Looking through feature script library, I saw no reference to opExtrude with a direction based on a 3d surface.

    opOffset on the other hand says it uses the face normal for the offset direction. Bingo!

    So...

    We can use the solid variant or the surface variant of the offset. After looking at the results using the UI to build both cases, I like the surface variant.



    So this means the input to this featurescript would be a face(s) and edge(s).


    An issue would be, when OS offsets a face, do you think you could query these edges, are they related some how so is it easy to match respective edges? 

    The next step would be to loft between the matching edge(s).

    And then lastly, delete the offset surface.



    What I like about the surface offset:
    -we won't lose the original surface id and won't break down stream features that referenced the original surface.
    -we can new/add the lofted surfaces
    -hoping we can apply opDraft to loft surfaces

    This would be huge, something SW can't do easily, adding a 2nd direction:



    Ultimately why? Offset curve on surface is something simple CAD just doesn't have, but it's a recurring design pattern when designing complex shapes.

    Here's an example of a ruled surface in action, the orange is an offset of the ruled and then a split & delete face was performed cleaning up the original blue surface's edges:


    Many times you want to clean up bounding edges to a 3d surface and doing this with sketch geometry is impossible.

    The 1st time I ran into this design pattern was creating rivets around the door of an airplane. Manufacturer wanted them equal distance from the door's open. 


     This might be out of scope of our original conversation, good news is it's doable.


  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    Looks like opDraft can draft these lofted surfaces. Ignore everything thats talks about neutral plane and the rest is about reference_entities.


    I think feature script could build a good ruled surface generator.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    Can you use thicken?
    It may be faster than lofting
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    You should be able to use opEdgeChange or opExtendSheetBody for trimming or extending your surface
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    My fear with thicken is that the resulting body might re-assign the selected surface reference id's

    As a result, you'd have 2 surfaces:
    -the original selected surface
    -the one bound to thicken

    I get why thicken is better, you don't have to construct lofts  keep track of edges trying to match them. 

    But you still have query solid and match up with selected query edges. This I think is the toughest part of this whole featurescript and I'm not sure which is the better approach.

    I'd be happy with either, 





  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    I can use startTracking(context, originalEdge) for each edge at the start to get the faces and edges coming from that edge
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    @billy2
    I have created a version with more options now, can you try it out?
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    edited December 2018
    Ok this needs a better name and should be released in a surface tool bar:




    Shortening is also included:


    holy crap, why is this a secret?:

  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    Ok, I going to delete solidworks from my computer and make room for some mp3's. 



    pattern it around:


    yeap, clean it up:

  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    @billy2
    Then you can use this feature to turn it into a part:
    https://cad.onshape.com/documents/84d939daceef6a928b8abcba

    What should I call the feature?
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • brucebartlettbrucebartlett Member, OS Professional, Mentor, User Group Leader Posts: 2,137 PRO
    Nice one, with a little push from @billy2

    I think I going need a Morgan Toolbar soon.
    Engineer ı Product Designer ı Onshape Consulting Partner
    Twitter: @onshapetricks  & @babart1977   
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    @brucebartlett
    @billy2
    What should I call the features below?

    Feature Name             Description
    opExtendSheetBody: Extends a surface body,
    opEdgeChange:         Changes edges on surface bodies,
    opCreateOutline:        Projects faces and parts onto an extruded surface or plane

    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO

    Used enclose, can you give me rights to copy opBoolean Surfaces?


    I liked to see how you do it,

    As far as naming goes, I don't know. I like Bruces suggestion "Morgan's Magical Toolbar".


  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    How about "Just give me an Onshape job already" toolbar?
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • brucebartlettbrucebartlett Member, OS Professional, Mentor, User Group Leader Posts: 2,137 PRO
    edited December 2018
    How about "Just give me an Onshape job already" toolbar?
    You need to do the Onshape Summer Internship or have you just started your own Australian Summer of Onshape Featurescrpting. 

    The tools name would maybe be "Surface Extent", "Edge Replace" or Edge Transform".

    I had a little play, I don't do much surfacing so a little rusty. For starters I thought I'd try offsetting some faces to get a even chamfer around a freeform shape but run into trouble here. https://cad.onshape.com/documents/01cfeaa7438b5325e7560233/w/083e880a30d5cb926f7de56e/e/40503249aaa96a34057a9ff6 



    Engineer ı Product Designer ı Onshape Consulting Partner
    Twitter: @onshapetricks  & @babart1977   
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    @brucebartlett
    Can you try using the opEdgeChange FeatureScript?
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,033 EDU
    billy2 said:

    Used enclose, can you give me rights to copy opBoolean Surfaces?
    @billy2
    The document is public, so you should be able to copy it.

    PS: the feature can work between a surface and a solid (It returns a surface trimmed to the solid)
    mb - draughtsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • brucebartlettbrucebartlett Member, OS Professional, Mentor, User Group Leader Posts: 2,137 PRO
    That doesn't seem to work either, it always fails after pulling the first edge back. 



    Engineer ı Product Designer ı Onshape Consulting Partner
    Twitter: @onshapetricks  & @babart1977   
Sign In or Register to comment.