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.

Custom Feature: Loft Fillet

ry_gbry_gb Member, csevp, pcbaevp Posts: 62 PRO
edited December 5 in FeatureScript

Because of @EvanReese's series on equations, variables, etc. in Onshape, I ended up getting sucked into the FeatureScript rabbit hole. Needless to say, I'm hooked. I'm not a real programmer, but I'm still pretty happy with coming up with something that'll automate a pain point in my CAD workflows. Plus, then I get to share this with the rest of my team.

Link to FeatureScript: Loft Fillet

I created a feature to help avoid the very common (but also very niche) occurrence when that arise from creating edges that terminate on smooth edges, tangent faces, you name it. They generally result in fillets that taper to a point or else just failing altogether. Usually, the workflow to get around this is to:

1. Sweep a circle
2. Extend sweep faces
3. Trim away main body faces
4. Create bridging curves
5. Loft between the open edges
6. Remaining cleanup with booleans, fills, and additional splits

Needless to say, it's a very involved process that requires a few steps and a ton of clicking. Loft Fillet does all of that in one feature. This feature was inspired by @MichaelPascoe's Analyze Fillet. I saw he had a Split Sweep feature, but I couldn't quite get it to work as I intended. I tried to handle as many use cases as I could think of, but obviously, I can't think of everything. Appreciate any feedback that you guys might have. If anything, feel free to peak under the hood to see if there are any optimizations I could implement.

image.png image.png

Ramon Yip | glassboard.com

Comments

  • S1monS1mon Member Posts: 3,739 PRO
    edited December 5

    Amazing. I've had thoughts of such a feature many a time, but never even gotten started.

    In theory a Face Blend with width control should make this feature unnecessary, but it seems to fail if the dihedral goes to zero. In your test cases, Face blend could only handle test case 4, everything else would take multiple extra features.

    Any chance that you can/will make the bridging curves G2 or G3?

    Simon Gatrall | Product Development Specialist | Open For Work

  • ry_gbry_gb Member, csevp, pcbaevp Posts: 62 PRO

    Thanks for checking it out!

    I figured this feature is a pretty niche, but I find myself going through the workflow way too often. Some of the test cases are covered by the vanilla Fillet, but I needed some quick geometry to test trimming away end caps and filling gaps.

    I can add implementation for G2/G3. It's a pretty simple change in the code. I wanted the feature to be up and running before introducing more complexity to it as I'm still really new to FeatureScript and haven't dealt too deep into programming, really.

    Ramon Yip | glassboard.com

  • jelte_steur_infojelte_steur_info Member Posts: 586 PRO
    edited December 5

    @ry_gb :

    Awesome feature! I can see myself using this one a lot in surfacing work. I can already think of a model that I could have simplified or improved with this feature.
    I second S1mons improvement request for g2 loft constraints and perhaps even g3 bridges.

    As a token of my appreciation, please find a Loft-fillet icon you can add to this featurescript to have it stand out!

    image.png
  • martin_kopplowmartin_kopplow Member Posts: 1,062 PRO

    That is a very useful one for those who do surface stuff. Thanks a lot.

  • EvanReeseEvanReese Member, Mentor Posts: 2,675 PRO

    Wow this is really cool, Ramon! It will definitely come in handy. I love that I've been able to be at least part of the inspo here.

    Here's what comes to mind for improvement ideas. It's already a very useful feature as-is and this is all just my opinion, so do whatever feels right to you and what you have the time and will for:

    1. it would be nice if the guides were set automatically to tangent if the surrounding geometry is also tangent. You could find those edges with some kind of adjacency query, and check with evEdgeConvexity(), then automatically match that, at least for tangent/positional. If you want to get even more extreme you could also check the curvature of relevant geometry with evCurvature() to compare it and know if you should also use curvature. I agree with others a g2 option is important for a feature like this.
    2. "Make loft" and "Merge surfaces" should be true by default. In the param map you can just add "Default" : true and if you think some users might not like that you could also add "UIHint" : UIHint.REMEMBER_PREVIOUS_VALUE to keep them set to whatever that user used last.
    3. I think "Edge debugging" might have more mass appeal and match the native featureset rebranded to "Preview edges". It should be false default, but remember the value. Btw I love that you added a tooltip to this one. Made it very clear.
    4. The Trim and Fill options might be automatable. Am I right to think that where the edge meets a sidewall a convex one should always trim and a concave one should always fill? That way you could even handle a mismatch case like this. Currently the trim works, but the fill doesn't happen, making the part a surface body. image.png
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • MichaelPascoeMichaelPascoe Member Posts: 2,673 PRO
    edited December 5

    Nicely done! This is impressive work. 😎👍
    It seems to handle most cases better that the Sweep blend. Adding this to my toolbar for sure.

    Doesn't look like you need it, but just in case, here are the two best places to learn FS:


    FeatureScript Fundamentals
     by Onshape

    FeatureScript Video Tutorials by CADSharp

    With @EvanReese's tutorial spree, I wouldn't be surprised if he has a FeatureScript series cooking somewhere on the back burner? 😃

    .


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • S1monS1mon Member Posts: 3,739 PRO

    Another thing I forgot to mention earlier, using the radius of the sweep is a little out of line with the width control in other tools. Technically, width and diameter are different, but I would be tempted to switch the parameter to the diameter instead of radius in order to get more similar results with the same number to the width control in the fillet and face blend features.

    Simon Gatrall | Product Development Specialist | Open For Work

  • EvanReeseEvanReese Member, Mentor Posts: 2,675 PRO

    You're right sweeping a circle is a bit different than a true chord width fillet, but I'm actually unsure how I'd even do that manually on an edge with varied dihedral angle. Any ideas? This feature definitely automates something I've done manually many times though. I like the idea of changing it to "Diameter". Fillet radius is a bit deceiving, as most people will rightly expect it to produce a blend with that radius of curvature, which it doesn't. I feel like there may be an even clearer wording, but I'm drawing a blank.

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • Derek_Van_Allen_BDDerek_Van_Allen_BD Member Posts: 379 PRO

    Serendipitous timing putting this feature out there around the same time that those bike guys were on the forums asking for more surfacy fillets for their omega bike studios. Seems like a great tool for product design.

  • S1monS1mon Member Posts: 3,739 PRO
    edited December 5

    One bug/feature request: right now this feature will switch a solid part to a surface, even if it's fully enclosed. I haven't done enough testing to see if this is universal, but I see that it happened in most of the test cases in the sample part studio, and in my own tests. It would be much better if solid parts stayed that way and kept the same name/internal ID.

    Simon Gatrall | Product Development Specialist | Open For Work

  • ry_gbry_gb Member, csevp, pcbaevp Posts: 62 PRO

    That's super odd, because in previous versions, it definitely was NOT doing that. I have "makeSolid" set to true in both opBooleans. I'll take a look when I have the time.

    Thanks everyone for the feedback. I'll make sure to implement of bunch of your suggestions. I agree with the point about fillet radius vs diameter. I think I'll just change it to "Blend Width" for now.

    Ramon Yip | glassboard.com

  • ry_gbry_gb Member, csevp, pcbaevp Posts: 62 PRO

    Special shoutout to @jelte_steur_info I was struggling to come up with an icon. What you sent over is perfect!

    Ramon Yip | glassboard.com

Sign In or Register to comment.