DVE2000 / Dogbone

A Fusion360 addin that creates dogbone joints for wood joinery.
148 stars 43 forks source link

Applying dogbones to multiple faces fails when that body has been duplicated with a lineair patern #36

Closed buikpijn closed 3 years ago

buikpijn commented 5 years ago

I use fusion360 to make parametric furniture and use a tool to lay out the parts for CNC cutting (nesting). If multiple faces are selected from different bodies that are multiplied using a lineair pattern the dogbones are only applied to the first face that has been selected. And another issue is that the dogbones won't work properly in parametric mode on mirrored parts. It throws an error screen and stops. Only remedy is to make them non-parametric, but i often had the issue that the dogbones where only applied on 1 of the 2 holes in the selected face. Selecting them again and performing the same steps again solves it.

And i personally find the 'allong shortest' and 'allong longest' description more intuïtive than the currently used ones :)

DVE2000 commented 5 years ago

Peter will probably have more to comment. But I'm wondering how you select the faces for different bodies? At the moment, block select does not work. You need to select faces by clicking on them. Peter has started a fix, but I need to find some time to work on it.

There are definitely some bugs in the Fusion API with parametric mode and mirrored parts, and as you've discovered you need to make them non-parametric. You may want to post about that on the Autodesk forums or open a case with them. The more people that bring it up, the more chance we have of Autodesk fixing it.

If you can duplicate the issue with only one of two holes getting dogbones applied, please turn on the logging and post the resultant file here.

As far as the last comment is concerned, if you let the cursor hover over the three "Type"s for a bit, a more detailed description pops up, telling you (among other things) that the mortise dogbone are ON the long or short sides. If you select the mortise dogbones, the "Mortise Type" icons have popups that tell you if they're ON the longest or shortest sides.

Edit: I fixed my comment above. I see what you mean about the nomenclature about the sides. It's ON vs ALONG. Blame Peter for that. :p

pludikar commented 5 years ago

Hi @buikpijn, When you pattern, do you pattern bodies or components? The dogbone add-in will work consistently with components and not bodies. Unfortunately, AD/F360 has made their internal workings unnecessarily complicated (IMHO), particularly when dealing with components and bodies - so to avoid making the add-in overly complex we made the add-in ONLY deal with one body in a component, and all others will be ignored. Note: You can use the dogbone add-in multiple times on the different bodies in the same component, but not at the same time.

I personally think it is good practice to make a 1:1 correspondence between components and bodies, particularly if you are going to nest. This way you can use joins between components to ensure that the orientation and separation between components can be controlled. Joins also ensure that the components are planar (all on the same plain). You can't do that if you are dealing with bodies.

However, to answer your issue: you can do one of two things: either add the dogbones to the body BEFORE you pattern the body, or you can pattern the component (assuming the body is in a component), in which case the dogbone will work before or after patterning.

An alternative is not to pattern in the design/model at all, but use the pattern feature in the CAM/Manufacture part of the program. Computationally, patterning in CAM/Manufacture is light years faster than in the model - it basically calculates the cut paths once and then copies the completed paths en masse to different offsets.

As Gary mentioned, we know about the parametric problem with mirrored components - AD screw up the internal model coordinate system when they translate a component or body into a mirror. You can try this for yourself. Create a component and in it, a box, and then make a mirror copy. Then change the orientation of the mirror (rotate it both up and to one side, change the height and offset). Try adding a hole to one face and make the depth using "To Object" and to the opposite face - you'll see that it either fails or it makes a hole trace which doesn't stop at the selected face (actually it will try to stop at the equivalent face of the original body - huh!!) If you can repeat that, please jump onto the F360 forum (either here or create a separate thread to complain.

On the 1-2 hole issue - do you see the missing hole creation event in the timeline? If you do, could you edit the hole feature and without doing anything just click OK. Does the hole magically appear? If it does - that 's a problem I'm working on, but it has the hallmarks of another F360 bug.

Ok - I'll be the fall guy for the ON vs ALONG :-) It's an easy change, which I'll be happy to do when we send out the next update - may not be for a while though. My goal was to make the add-in as intuitive as possible (given F360 limitations) - so I'll happily consider any suggestions on any aspect of the add-in.

Let me know if any of this doesn't make any sense, otherwise let me know how you get on.

Peter

Edit: Patterning bodies creates new separate body entities - they are not related to each other. So, if you make a change on one body, the change is not reflected in the other bodies. Components are actually just position and orientation wrappers around a base body that is common to all occurrences of the component. If you make a change in one component body, you are actually making a change to the base body, which in turn is reflected in each component occurrence. The add-in will recognise each body in a component as a separate entity - the add-in will allow a face on body1/component1 to be selected at the same time as a face on body2/component1. However the add-in will not permit a face on body1/component1:x to be selected if body1/component1:1 has already been selected (because they are actually the same body)

buikpijn commented 5 years ago

Thanks for the comments and suggestions. With the original version (that didn't had any parametric) I made the dogbones in the final step. (every single time parameters changed, I nested the part and added dogbones) this way (with the bones added before the nesting, being parametric) it works even easier. (call it blindness by habbits, elephant paths)..

I have something else now. When creating a dogbone parametric (and I agree, parametric and mirror appears to be somewhat buggy in Fusion) But... with the older version that had the parametric feature this issue doesn't occur;

With the dogbones along the shortest side, this is the result (wrong) and with the dogbones along the longest side, with parametric enabled, it throws in this artistic creation;

(and sized to differ 2mm to between longest and shortest, but the result stays the same.

The version of David Liu does all this just fine. It creates the dogbone as expected.

2019-01-21 08_50_51-window 2019-01-21 08_49_30-window

pludikar commented 5 years ago

Hi @buikpijn,

Don't you like machine generated art? Just kidding :-) That's definitely an issue I have to look at - not sure exactly why it's doing that.

The issue with David Liu/Patrick Rainsberry/Casey Rodger's implementation is that it was very limiting. As soon as you attempt to make dogbones for the whole body on anything other than root level bodies it would inevitably throw an error. I needed something that would work on sub-components in an assembly - the errors in the original version and its derivatives was my main motivation to rewrite this add-in. For the most part it does that, but I've had to find and implement many work arounds, just to get the add-in to work as well as it does. AD has not made it easy to use their API for anything but the simplest of coding. I strongly suspect that this add-in is the first to implement a general purpose "work at any model/component level" that F360 has actually seen.

I'm pretty sure that I'm going to have to re-think the implementation of the parametric mode. At the moment it relies on creating hole features referenced to edges and object reference depth. That means dogbones will move to accommodate change wall and depth changes. The original version doesn't accommodate depth changes. So, for instance, if you change the thickness of your board stock, and you have rabbets or dados that are 1/2 board thickness deep, then the original version will either leave a hole indent or a step if the thickness changes. Neither result is very desirable.

I've used holes because they are native features - in principle they should be very robust and quick to calculate, but... F360 has many bugs in the hole feature department! I would like to put pressure on AD to actually get their product to work as advertised - the more people who complain the better chance there is of them actually doing something about it, instead of spending effort adding new features.

I apologise if this sounds like a rant - to a degree it is, but it's a rant against AD not anyone who uses the add-in. If you can add your voice to the complaints, I'd really appreciate it. The complaint has to be about generating holes, it can't be about the dogbone add-in because that won't get anywhere.

Peter

pludikar commented 5 years ago

Hi @buikpijn

I've just found the issue and there's a new version in the Git repository. It's not been tested by anyone other me - if you are willing to try it out - You just need to download the new dogbone.py file here and replace the file of the same name in the API directory (all other files remain the same).

Obviously you will be the first to try this out. I probably won't release this until I've resolved a few other issues.

Let me know if you need help

Peter

buikpijn commented 5 years ago

Thanks for the comment Peter, (and the support)! I understand where you're coming from. I still have issues with the Cloud-services. (which is highly unreliable to say at least) Honestly; i couldn't have started my business without them, so i'm pretty happy with their features (cad/cam) and the start-up program they provide :).

If i can be of any service in the hole-department. There are also some CAM issues, which relies on the initial model you based your cam upon.. If you later change something to the layout of the parts, the cam just won't follow sometimes. You'll have to close and re-open Fusion to get the new layout working properly. But i must admit; that issue hasn;t occured anymore since a few months. Didn't read about it in the release notes anyway.

Just tested the dogbone.py (along shortest, along longest, great!!) but now the outcome is always along longest, also when i've selected 'along shortest'

One of the parameters I use is the thickness of the material (using mortises that depend on the thickness) and i noticed it doesn't work with the previous versions. Yours follows perfectly. 👍

pludikar commented 5 years ago

Hi @buikpijn

Sorry about that - I was a little too exuberant about changing "On Long side" to "Along Longest". In the process I accidentally changed an identifier, which stopped the choice being recognised. I've updated the file - It should work now.

BTW If you have an exactly square mortise, the add-in can't figure out which side is longer (obviously) and the position of the dogbone will be uncontrollable. However, if you can make one side slightly longer than the other (even by 0.0001 in/or mm) then it should work consistently.

I hope that helps. Peter

DVE2000 commented 5 years ago

The issue of square mortises probably exists in the original version that I created too. There’s no way to know.

pludikar commented 5 years ago

Hi @buikpijn

I've figured out a work around for the parametric mode mirror problem - and I think I've fixed it. Would you be willing to try it for me and see if it does solve the problem with mirrored components? I can't guarantee that I haven't broken something else - if you find an issue could you let me know. The latest version in the github code page is the one you will want to try.

Regards Peter

buikpijn commented 5 years ago

Just tested it;

when i have an original and a mirrored part, and select them both at once to do a parametric cut it finishes 1 and the mirrored part stays untouched. now adding dogbones to that mirrored face in that situation, (where the previously described situation is still active) in non parametric mode it creates an icon in the timeline, but doesn't compute the dogbones on the mirrored part. If i undo both actions, and create dogbones on the mirrored part without parametric checked, it works as expected.

I know Fusion is weird.

Tested something else; made about the same part with no underlaying complexness. I i leave the parts untouched, dogbone works as expected. But i'm using mapboards to orient the parts flat, for easy machining. and this is where it goes wrong. Mapboards relies on copying the parts and paste them into a new part, while orienting/aligning them differently. I tried aligning them horizontal by hand, but this gives no issues.

Rene

pludikar commented 5 years ago

Hi Rene, Many thanks for trying it. It's clear to me that F360 has a bug that depends on the orientation of the part. I had it working consistently on several test models, but today I tried it on a different model and it failed with an error. I have more work to do - basically need to figure out what the bug is in detail (I already have a good idea) and then identify the situation in order to apply a specific workaround. I see this as a fundamental F360 bug, but they don't seem to want to do anything about it.

Would you be willing to send a copy of your model?

Regards Peter

buikpijn commented 5 years ago

Hi Peter;

Just discovered something, perhaps you'll recognise it.

When selecting two faces, only one shows the blue lines of the edges. see screenshot;

schermafbeelding 2019-02-12 om 20 21 59

Anyway, created a model, please feel free to use it; hope you can seen the 'map:1' file.

https://a360.co/2SvPBAm password is DogboneDogbone

pludikar commented 5 years ago

Hi Rene, I think there's an inconsistency in your model - not sure where yet. When I first selected the three components I did get the same missing edges, but after playing around with your model just to understand how you've put everything together, the edges came up on all three bodies. I suspect that here's a hiccup in the model's cache, but I'll investigate further.

For any component that you mirror, and don't change later - I would suggest you apply the dogbones just prior to the mirror event (roll back the timeline to just before the mirror and then activate the dogbone add-in). I noticed it seemed to take a long time to calculate the dogbones for the 3 parts (probably 30 seconds or more, for 150+ dogbone edges), if you add the dogbones before mirroring, it takes a few seconds (less than 10), and the rest of the process is really quick. You then won't have the mirror issue.

Are you using an add-in or script for the mapping? I'm just curious because the list of parameter names and types indicates that might be the case. I'd be interested to find out more about it, if that's the case.

I would strongly suggest you to create empty components, then add bodies/design into the active component. Don't mirror bodies, apply that feature to components only. F360 can get confused internally when you create bodies first then move them into components. This is going to be particularly important if you want consistent parameterization in the future. Where possible only work with components - keep operations to bodies to a minimum. I now try to avoid using sketches too - I've suffered many hours of rework because a profiles in a sketch or two becomes unreferenced after I change a parameter value.

I'm still working on the fix - thanks for your help so far.

Peter

Peter

buikpijn commented 5 years ago

I'll create empty components and start from there, thanks for the tip. Greatly appreciated. (and I truly mean it) I draw a lot in Fusion, but coming from Solidworks, building up the 'fusion' way is sometimes a bodge. Trying to do as much parametric as possible, creating parts from parametric defined planes etc, but with complex parts you want to change at the end, you'll get a kick in the nuts sooner or later.. :) I've made a CNC depending on fusion, and with a relative complex part, you'll have to rebuild the design several times in order to become more predictable/stable. Thanks for the tip! The parts are for furniture, and this (not actually the part i've shared, but the original part) is depending on a pattern feature, and a few other parameters. All the other components have the dogbones corresponding, in the design, and that works like a charm, but these last two parts simply need to be done by hand. (after mapboards is applied)

One thing though; the dogbone version I mentioned earlier (also parametric) has no issues with the parts.

And you are right; the parts are laid flat using mapboards, mentioned it in the previous post. It doesn't nest, but it lays components flat on a surface. Mapboards is indeed creating a bunch of parameters.

pludikar commented 5 years ago

@buikpijn Hi Rene. I just want you to know that I've been trying to find a work around for the parametric issues, and I've kept hitting similar F360 bugs. The process of creating a mirror of a body or component, introduces a significant flaw in the internal model which appears when anyone attempts to link parametric holes, among other things. So unfortunately, until F360 actually fixes the fundamental issue, there's not too much I can do.

If you create bodies and convert them to components, in order to move them around or link them with joins any add-in or script will inevitably suffer the same problem; this is what Mapboards does. The original dogbone version, unfortunately will not only fail the same way, but also will not handle components consistently - most of the time you'll get error messages. I'm familiar with the original version because I tried to fix it, before I figured it was easier to start afresh.

As I mentioned before, unfortunately the only way of getting consistent parametric dogbones, at the moment, is to add the dogbones before the parts are mirrored - if it's at all feasible. I'll send you an update when AD fixes F360 and I've got the add-in working consistently.

Regards Peter