Skip to content

Splitting an object with pins & holes

Merill edited this page Aug 23, 2020 · 2 revisions

Hello this little tutorial will guide you in how to split an object that is too big for your build plate, and adding pins & holes for easier assembly.

1) Be sure you have:

  • SuperSlicer with at least version 2.2.53
  • FreeCad at least v0.19 (v0.18 should be enough for this tutorial, but v0.19 is needed to write text)
  • put your FreeCad bin directory in "Configuration -> preference -> FreeCad path"

2) load your too big stl

3) Rotate it

For easier scripting, rotate it so you can cut it in the z axis (like you do with the cut tool). But don't cut it yet.

Create a cylinder with enough z and the size of the pins you want to create. Here, I added a cylinder with 5mm as x and y, so it's diameter is 5mm (2.5mm radius). Move this cylinder where you want to add a pin and note the x & y position. If you nee more precision, you can cut the sword with the sword cut, write down the X and Y positions and revert.

These xy coordinates will be useful to know where to create the pins. Here, i selected 80,90 and 100,90

4) write your script

To open the script window : Generate -> FreeCad python script (alt-g -> enter)

In the script, we have to create two objects:

  • The first is the object from the platter, cut above z=160 and with two pins added at (80,90,160) and (100,90,160).
  • The second is the first object from the platter, cut below z=160 and with two holes at (80,90,160) and (100,90,160).

union("bottom with pins")(
	cut()(
		$1,
		cube(200).move(z= 160),
	),
	cylinder(2.3,10).move(80,90,160),
	cylinder(2.3,10).move(100,90,160),
),
cut("top with holes")(
	$1,
	cube(200).move(z= -40),
	cylinder(2.5,12).move(80,90,160),
	cylinder(2.5,12).move(100,90,160),
),

Here is the explanation of the script:

  1. comment
  2. create a union (fusion) with name "bottom with pins". As it's a top level thing, this name will appear in superslicer gui
  3. create a difference object (remove things from something)
  4. The object we cut into is $1, it refers to the first object in the right panel of SuperSlicer
  5. we remove a big cube of 200 mm on each side to the sword from z=160. It's enough to remove everything above z=160.
  6. end the cut
  7. create a cylinder with 2.3mm of radius and 10mm height. To be added at the right place, move it to the noted xy from the previous image/step and the cut z.
  8. same, we want two pins
  9. end of the union
  1. comment, start of the second object definition
  2. we need only a cut for this one
  3. we cut into the sword object, like for the previous one
  4. remove everything below z=160 (as it's a cube of 200, we need to move it 200 below 160, so 160-200 = -40)
  5. create pin holes, it's like for creating the pins, but the diameter has to be slightly larger (depends of your printer and how tight it prints) and sightly longer for clearance
  6. second pin
  7. end of cut and the second object

5) Clic generate to apply your script.

In the bottom bar, you may want to select "insert" instead of replace if you're not sure of what you do. If you forgot to do that, you can always go back with ctrl-Z.

6) rearrange and print your cut objects

You can export their stl with the contextual menu.

Note that you need to activate supports to print these pins here, but sometimes you don't have to if you can let the object on the z-axis.

notes

wiki page for the script syntax

sword model by Yourmom23333