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.

Laser Joint Updated to V3.0: Pin Face Offset and Pin Chamfer!

lemon1324lemon1324 Member, Developers Posts: 225 EDU
edited November 2017 in FeatureScript


Direct link to the new version here.

Pin end faces can be offset either in or out; convex pin edges can be chamfered to aid insertion.

End face offset as requested by @Hugh_Goodbody, @michael3424, and @brucebartlett.

Notes: 
Performance on joints with no options is the same; pin face identification is currently the most inefficient computation, so offsetting pins on very large automatic joint operations may take some time.  Everything is fast enough to easily use for manually tweaking single joints when not in automatic mode: a single joint with all options enabled executes in under 0.5 seconds.  Recommended use for automatic mode is to set up the laser joint feature at the end of the feature tree, roll back to previous, and then make adjustments there until ready to recompute all joints.

When finding pin terminal faces, for now I'm only selecting faces which lie entirely on/in the intersection volume prior to the pins being created.  This means if the "tab" part overhangs the "base" part, the outer two "pin" faces will not be offset, only fully internal ones.  Current recommendation for now is to manually offset these if it's critical.

I also found that in cases where more than two parts initially occupy a joint at non-square angles (e.g. at the corners of a hexagonal prism), small disconnected components can be created, which sometimes caused some joints not to be generated correctly.  In addition to fixing the query in these cases, I've also added code which automatically deletes these disconnected components if they occupy less than 0.1% of the parent body volume, and displays an info message to the user.  Disconnected components larger than this will be identified, not deleted, and a warning to check for intended function will be displayed, while the joint completes as computed.

As always, no bugs found on my test cases, but if you find any, send me a link to a public document with a minimum example demonstrating the problem and I'll look into it as I get time.  PhD responsibilities come first, so I recommend if you get any bugs breaking functionality to revert to a previous Laser Joint version until I can get a fix out.
Arul Suresh
PhD, Mechanical Engineering, Stanford University

Comments

  • brucebartlettbrucebartlett Member, OS Professional, Mentor, User Group Leader Posts: 2,141 PRO
    Thank you
    Engineer ı Product Designer ı Onshape Consulting Partner
    Twitter: @onshapetricks  & @babart1977   
  • Hugh_GoodbodyHugh_Goodbody Member Posts: 40 PRO
    Fantastic enhancements
    Thanks
  • Marc_MillerMarc_Miller Member Posts: 110 ✭✭✭
    Excellent, thank you @lemon1324

  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    Terrific - thanks!
  • Hugh_GoodbodyHugh_Goodbody Member Posts: 40 PRO
    @lemon1324
    Arul, would it be easy enough to allow sheet metal bodies to be picked as well as solid bodies?
  • lemon1324lemon1324 Member, Developers Posts: 225 EDU
    @Hugh_Goodbody

    I haven't looked in detail at how sheet metal bodies are queried in the code; my understanding is that operations on active sheet metal parts actually modify the flat pattern directly.  With this and the very likely case that each part is no longer planar (which is the core assumption of the code currently), I think it would take a near complete rewrite or a new feature from scratch to get that working.

    Would you want such a feature to only join sheet metal parts to other sheet metal parts, to deal with a mix of sheet metal and non-sheet metal parts, or to do laser cuts on the bend lines, like this?
    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    Hi @lemon1324 ,

    Sheet metal features act on a folded-up sheet body representation of the sheet metal, which is then built out into 3d and flattened into the flat pattern by "updateSheetMetalGeometry(...)"

    You don't really have to worry about this, though if you were to want to adapt your feature.  On a high level, any feature that you can use to edit sheet metal in the graphics area can also be used to edit sheet metal in a custom feature.  In other words, if you use the "extrude(...)" function rather than the "opExtrude(...)" function, you can cut sheet metal without ever thinking about how sheet metal works internally.

    A word of warning: features that affect sheet metal can cause performance hits.  If you are cutting five tabs along a planar sheet metal part, it will be much faster to call extrude() once than five times.  That being said, your best bet to adapt the feature with good performance would probably be to create a bunch of tools and then just call "booleanBodies(...)" (this is the FS name for the "Boolean" feature) once to subtract the tools from the targets.
    Jake Rosenfeld - Modeling Team
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    Feel free to follow up here or DM me if you have additional questions.
    Jake Rosenfeld - Modeling Team
  • marcus_jonssonmarcus_jonsson Member Posts: 4 PRO
    Thank you for this @lemon1324 ! This works really good!

    I am designing laser cut steel parts to be welded together, up to a couple of meters in length. The problem is that the desired tab length (30-40 mm) gives to many tabs and would result in more cutting time on the laser and more welds.

    Is there any way to get a fixed tab length and fixed number of tabs equally spaced? Result from Laser Joint V3.1 at the top in the screenshot and the desired result at the bottom.

    For example; eight 40 mm long tabs equally spaced, with 30 mm edge offset.
    Or; X number of 40 mm long tabs with 150 mm spacing

    Fillets on the corner overcut edges would also be a great feature.


  • lemon1324lemon1324 Member, Developers Posts: 225 EDU
    @marcus_jonsson I can look into that; I think it should be pretty easy to add if the input parameters are the number of pins N and a desired pin width W, resulting in N pins of width W equally spaced along the joint.  Edge offsets in this case would apply to the outer two, and should end up looking like the desired result in your screenshot. That option probably won't be in the automatic mode as there's too many ways to then adjust the joint to fit and whichever I choose will probably be bad in at least some cases.

    How important are fillets on the corner overcut edges? (And what are they used for? Smoothing the toolpath for faster cuts? Legitimately curious since I didn't think of that as a thing that would be useful).  It would be pretty easy to add that functionality, but adds yet another option in what's getting to be a moderately unwieldy UI at this point. The nonequal pin/spacing option seems obviously useful enough that it's definitely worth the extra input selections.
    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
  • marcus_jonssonmarcus_jonsson Member Posts: 4 PRO
    That sound good @lemon1324, as long as I could get it in Single mode it would be a huge time saver compared to adding two sketches and two extrudes on one tab+pin and then sketching a line to use Curve pattern to space them equally! And repeating this for all parts/sides to add.

    I do not think the UI have to change that much. Maybe adding a Fixed pin sizing checkbox with a show on click Pin width input. And using the existing number of pins input. Something like this maybe:

            if (definition.adaptive == false)
            {
                annotation { "Name" : "Fixed pin sizing", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
                definition.fixedPinSize is boolean;
        
                if (definition.fixedPinSize)
                {
                    annotation { "Name" : "Pin width", "UIHint" : "REMEMBER_PREVIOUS_VALUE" }
                    isLength(definition.pinW, PIN_WIDTH_MAX_BOUNDS);
        
                }
            }

    The fillet is not that important, just a nice to have feature. You are correct, it is for smoothing out the path, every time there is a sharp corner the laser have to decelerate more which takes longer time (and therefor higher cost). Depending on the laser, or when using cnc plasma there is also a risk to to overburn (causing lots of dross) or burn away sharp edges.
  • lemon1324lemon1324 Member, Developers Posts: 225 EDU
    @marcus_jonsson I think I got both of those working; it might take me a couple days to finish testing and updating the documentation, but I'll tag you in the post for the new version.
    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
  • brucebartlettbrucebartlett Member, OS Professional, Mentor, User Group Leader Posts: 2,141 PRO
    Awesome Arul, thanks for the continued dev of this FS. I have often thought a fillet on the relief corner would be good to smooth the path for cutting but I even wonder if there is a perfect shape with maximum curvature for the optimized cutting and fast processing in Onshape. 
    Engineer ı Product Designer ı Onshape Consulting Partner
    Twitter: @onshapetricks  & @babart1977   
  • marcus_jonssonmarcus_jonsson Member Posts: 4 PRO
    Really great work @lemon1324 ! The only weird behavior I found with fixed pin size was clicking Toggle pin/gap, not sure what it should do thou, so I think it is ok.

    Pin chamfer could be a fillet instead to fix the same problem with with sharp edges. Added it in my copy, but maybe it should be switched to be able to pick only chamfer or fillet? Use it if you like it!

    Another thing I realized when testing it out was that i was able to join to crossing parts, which is a good thing. The problem is that it resulted in two parts that could not be joined in reality without cutting apart one of the parts. Something like this is a nice way to do it.
  • lemon1324lemon1324 Member, Developers Posts: 225 EDU
    @marcus_jonsson an option for pin end fillets should be pretty straight forward too.  I'm going to go through and add some error checking for slightly more helpful messages when interactions between features breaks things.  Just make sure that when I actually put out the documented version you update to that versioned release instead of your copy so you get any bug fixes as they happen.

    As far as the crossing parts, those are intentionally left out of scope - there's  the Lap Joint feature  @NeilCooke wrote that handles that case, although without doing the corner overcuts.  I haven't come up with a robust, computationally inexpensive way of automatically detecting that situation.

    @brucebartlett Fillets seem to be pretty fast, and cylindrical corner overcuts means I can use primitives and a boolean (fCylinder/opBoolean), so for regeneration times I'm pretty sure that's the most efficient rather than trying to sketch and solve some optimal curve.  More curvature from more radius on the overcut/fillet is probably the best as an overall compromise.  If your machine time is that valuable, CAD each overcut by hand!  ;)
    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
  • gareth_farringtongareth_farrington Member Posts: 10 ✭✭
    Kudos on this script and thank you for writing it!!
  • aaron_harris672aaron_harris672 Member Posts: 9 PRO

    Can this be used on frames (angle and box section)?

  • lemon1324lemon1324 Member, Developers Posts: 225 EDU

    @aaron_harris672 It'll probably do something, but even if it does, I suspect it won't work entirely as you think, the core assumption right now is that parts are planar and intersect along a line. Working with tube sections I think would require a large enough refactor that it might end up being a different feature altogether.

    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
Sign In or Register to comment.