Help with add-in for cutting finger joints
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm new to Fusion (started 2 days ago) and enjoy the idea of designing in a parametrized way. As I come from a programming background, I thought, I'd try writing an add-in as a way of getting to know Fusion. I'm starting to get a grip on the API and managed to create a new command to perform some of the steps below but I still have conceptual problems in making the add-in work in a parametrized setting.
I would like to share my plan for this and the problems I ran into so far. I hope some of you can help me with this or have useful constructive feedback. My goal is to implement a tool that takes two overlapping bodies and an axis and cuts finger joints perpendicular to the axis into the bodies to resolve the overlap. I have seen a very useful video about finger joints but I would like to make this a bit more general where it can work on any two overlapping bodies. This is how I imagine this operating:
Step 1: The user selects two overlapping parts and an axis. (I forgot the axis in the screenshot, it should be z axis.) She also enters values for finger width and distance (or alternatively the number of fingers).
Step 2: We create new bodies from the intersection of the bodies.
Step 3: We create a plane along the axis and through some arbitrary point. The choice does not matter as long as it is not on the line itself (because then the plane is underdefined), so we could use the first base vector that is not along the line.
Step 4: We create a sketch on that plane and project in the bounding box of all the bodies created in step 2. This step already shows the two main problems that I am having:
- (Problem A) How can we select all bodies of a component or all profiles in a sketch in a parametrized way, so that if the number of created bodies changes in the previous step, we still use all bodies?
- (Problem B) How can we access the bounding box of a component or a body and project it to a plane?
Since I do not know how to solve these, the screenshot uses the projection of the body instead of its bounding box.
Step 5: We create a rectangle on the sketch from step 4 that goes all the way across the part, so its left and right side are colinear with the edges of the bounding box (which I do not have, see Problem B). The height of the rectangle is the user input for the finger width and the location can also be computed from the size of the bounding box and the user input. We then use a rectangular pattern to replicate the rectangle once for each finger. The number and distance of fingers can again be derived from the size of the bounding box and the user input.
Step 6: We now have rectangular profiles where the fingers should be. In my case, since I projected the whole body instead of the bounding box, I had a lot of additional profiles in the sketch that result from intersections of the projected lines with the rectangles. I only want the profiles of the rectangles I created and I want to select all of them in a parametrized way (see problem A above).
Step 7: We can use extend to cut the profiles out of the bodies created in step 2. For this step, I thought the settings "direction = two sides" and "extend = all" for both sides would do what I want, but in the example, setting "extend = all" kept the extend at 0. This would also be no problem, if we had the projection of the bounding box onto the plane perpendicular to the selected axis (xy in this case). But this again is problem B.
Step 8: Now we select all bodies that result from step 7 (doing this in a way that works when the input changes is problem A again). We then use them to cut the fingers out of one input part.
Step 9: With one part ready, we can simply use it to cut the fingers into the other part.
Step 10: Finally, we can clean up by removing the temporary component and the sketches that were created on the way.
So to me it looks like my main problems are projecting a bounding box into a plane and selecting all objects that resulted from a previous operation in a parametrized way. Of course it could be that one or both of these problems is not solvable. In this case, I'd like to hear your thoughts about how to approach this problem.