# Box with bayonet joint

**URL:** <https://discourse.mcneel.com/t/box-with-bayonet-joint/158875>\
**Category:** Grasshopper\
**Tags:** windows\
**Created:** [April 25, 2023, 9:03am UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875 "2023-04-25T09:03:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![hvn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hvn/32/694101_2.png) [@hvn](https://discourse.mcneel.com/u/hvn)\
**Post date:** [April 25, 2023, 9:03am UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/1 "2023-04-25T09:03:37Z")

</div>

Dear everyone!  
I’m new to Rhino and Grasshopper.I would like to make a box with Bayonet joint like step file below.  
Does anyone have ideas how to do it with grasshopper?  
Thank you.  
 ![Bayonet joint](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/a/5/da5ed8c4063edacb44fd123c22ce0e092f5f8027.png)  
[Bayonetjoint.stp](https://discourse.mcneel.com/uploads/short-url/xhIFjPAuGNsuwIKLQOfpvw5S28H.stp) (214.3 KB)

---

<div class="post-metadata">

**Author:** ![ftzuk](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ftzuk/32/689170_2.png) [@ftzuk](https://discourse.mcneel.com/u/ftzuk)\
**Post date:** [April 25, 2023, 9:13am UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/2 "2023-04-25T09:13:22Z")

</div>

Is there a reason for doing this in Grasshopper and not in Rhino?

---

<div class="post-metadata">

**Author:** ![hvn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hvn/32/694101_2.png) [@hvn](https://discourse.mcneel.com/u/hvn)\
**Post date:** [April 25, 2023, 9:33am UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/3 "2023-04-25T09:33:58Z")

</div>

Hi Ftzuk!  
I would like to do this in Grasshopper, because I want to change the different thickness, length and height later.

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [April 25, 2023, 10:58am UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/4 "2023-04-25T10:58:28Z")

</div>

Hello  
welcome to Rhinoceros and Grasshopper. I think, from my experience, that the best method is to dive into Grasshopper and try to solve your problem. It is better to have some experience in Rhinoceros, because it is easier to replicate in Grasshopper what you do in Rhino.

Your problem is not so simple. For example what is the 3d file needs a CNC that has more than 3 axes because the cuts are not perpandicular.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/c/2/4c27917259e788ff4ee675660e7f4d7f5bed5009.png)

It is more easy to model that but it is more difficult to make (laser cut for example).  
If you want just 2d cuts it is a bit more complex to develop. But it all depends if you want an automatic dor all cases or just a tool that work on some defined situation.  
So could you eleborate on the exact parameters you want?

Examples of slits

> [@Nautilus plugin](https://discourse.mcneel.com/t/nautilus-plugin/152425/32):
>
> I am working on some new components. It is like the Region Slit from Grasshopper but I tried to add some new features, engulfed curves and non perpendicular planes. It is intended to output shapes that could be done with a 2D cutter(a saw, cnc). It works quite well but it has some limitations as it is not using 3D boolean, just 2D boolean (could be not assembled, if the end of a curve is too near from another curve …) Here an example very simple. I get that Grasshopper sli…

---

<div class="post-metadata">

**Author:** ![hvn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hvn/32/694101_2.png) [@hvn](https://discourse.mcneel.com/u/hvn)\
**Post date:** [April 25, 2023, 12:18pm UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/5 "2023-04-25T12:18:09Z")

</div>

Hi Laurent Delrieu.  
Thank you for the quick response. It is good that you know exactly what I want. I would like to cut this in 2D-laser machine. But if it is diffcult to do this in Grasshopper for 2D cutting, can you make for 3D-axes machine in Grasshopper? I can convert the cuts to perpandicular later for the laser cutting. I’m sorry about my english.  
The parameters I would like to have is something like this.

 ![Bayonet joint parameters](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/6/6/066b9c7ea73d51b02def67f77ede2dcd0be55e30.png)  
[Bayonet parameters.STEP](https://discourse.mcneel.com/uploads/short-url/6dCkYUu75Boju3XBOynMCd6RuAU.STEP) (914.0 KB)

---

<div class="post-metadata">

**Author:** ![Quan\_Li](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/quan_li/32/679256_2.png) [@Quan\_Li](https://discourse.mcneel.com/u/Quan_Li)\
**Post date:** [April 25, 2023, 1:23pm UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/6 "2023-04-25T13:23:01Z")

</div>

[Bayonet joint box.gh](https://discourse.mcneel.com/uploads/short-url/zdpqtmzSVqkwvzJbjPxiqBVSbcG.gh) (48.3 KB)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/5/7/4578a26175ebba7ab41fbb6db222b2a3ea476703.png)  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/b/d/1bdd6c56e956c4f5330c18be82b06634e4cd4f80.jpeg)

---

<div class="post-metadata">

**Author:** ![hvn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hvn/32/694101_2.png) [@hvn](https://discourse.mcneel.com/u/hvn)\
**Post date:** [April 25, 2023, 1:28pm UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/7 "2023-04-25T13:28:39Z")

</div>

Thank you so much Quan Li.  
Can you design from begin in grasshopper without step file I uppload here? Because I want to change angle of the box.  
When I open your file I have this message.  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/a/4/5a43a77f5fe717de21b14d862eea0d6b1f97c24e.png)

---

<div class="post-metadata">

**Author:** ![Quan\_Li](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/quan_li/32/679256_2.png) [@Quan\_Li](https://discourse.mcneel.com/u/Quan_Li)\
**Post date:** [April 25, 2023, 1:31pm UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/8 "2023-04-25T13:31:07Z")

</div>

MCAD like Fusion or Solidworks are wiser choices.  
Easy to make and maintain.

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [April 25, 2023, 5:40pm UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/9 "2023-04-25T17:40:56Z")

</div>

There are always many different strategies to solve a problem.  
If you have cuts that are not orthogonal you can  
orient the pieces in order that they sit on plane XY, I decide that the biggest area part contains the plane.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/0/f/f0ffe56b35101a7a8ed064b6bc6973c904d627d4.png)  
Then I pack geometry in order to see each one, I use my plugin but this is not mandatory just nicer  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/9/c/d9c4cefb24be33f5c5a0520e48f28d16cd342ba2.png)  
Then project the contour of 2 biggest faces on XY plane  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/9/0/b906bf9797676a23d7cd2a167deab7f150e1dce1.png)  
Then the idea will be to make the intersection of the outer shapes and union the holes. It is quite easy to do with Clipper library but I don’t know if there is a tool to do that in Grasshopper. So the idea is still the same.  
Sort by area, reverse the list. 2 first curves must be the outside and the others the holes. Intersection some, union the other  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/3/4/8342f42b993577fc7262c036b2200682d476fe30.png)  
And you have your 2d curves usable for cutting  
But you can also cut everything and you will have to many cuts but at the end you’ll just have to sort the pieces.  
[orient sheets.gh](https://discourse.mcneel.com/uploads/short-url/mNwSIhQwCEOLNmLpAxyLgCZN1Ks.gh) (121.7 KB)  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/b/6/5b609ed72e9b36750a6931d5fa3db76be3271ea7.png)

The other logic is to use median sheets associated with a thickness. It is what is done in Region Slits tools  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/2/f/02faeca2ecf143c3c8b85308ad54931682ef58e4.png)

---

<div class="post-metadata">

**Author:** ![Quan\_Li](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/quan_li/32/679256_2.png) [@Quan\_Li](https://discourse.mcneel.com/u/Quan_Li)\
**Post date:** [April 25, 2023, 7:37pm UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/10 "2023-04-25T19:37:33Z")

</div>

You don’t need to install pOd plugin, it is just for preview at the very end.  
It was designed from scratch, but if you want variations from this, better study it first.

---

<div class="post-metadata">

**Author:** ![hvn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hvn/32/694101_2.png) [@hvn](https://discourse.mcneel.com/u/hvn)\
**Post date:** [April 26, 2023, 4:35am UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/11 "2023-04-26T04:35:56Z")

</div>

Ok Quan. Thanks. I will study your grasshopper file from scratch.

---

<div class="post-metadata">

**Author:** ![hvn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hvn/32/694101_2.png) [@hvn](https://discourse.mcneel.com/u/hvn)\
**Post date:** [April 26, 2023, 4:58am UTC](https://discourse.mcneel.com/t/box-with-bayonet-joint/158875/12 "2023-04-26T04:58:32Z")

</div>

Many thanks for your help.
