Welcome! Log In Create A New Profile

Advanced

Positioning problem on the bed

Posted by Replace 
Positioning problem on the bed
March 13, 2013 05:09AM
Hi All,

I have developped a way of engraving text or images into objects. I use OpenScad to subtract a one-layer object from another (main) object at the first layer.

For this I use Slic3r to slice both objects separate

Than, I first print the one layer object. I home the extruder, change the filament and I print the main object.

Result = an object with an engraving in the nice side (the hotbed side of it)

This works great when both objects are centered and same size (approx) Example: [www.thingiverse.com]


However, when the main object is much bigger, Slic3r will not put the objects at the same place, so the engraving does not fit in the excluded space.

Any clues on how positioning or centering works in Slic3r ?

Thomas

Edited 1 time(s). Last edit at 03/13/2013 05:10AM by Replace.


www.3daybreaker.blogspot.com

Orca V4.4 rebuild to Ramps with Mk8 and E3D, as well as a Rostock Delta Mini and an OLO in backorder :-)
Re: Positioning problem on the bed
March 13, 2013 05:52PM
I know someone who was doing this, and had the same issues. He decided to make a 1 layer height border around the second (smaller) object, the same size as the first object. He then removes the border manually from the print table after printing the smaller object. As the outside of both objects is now the same, both prints are centred correctly to each other.
Re: Positioning problem on the bed
March 15, 2013 10:00AM
Thnks

this sounds reasonable. So this is what i will do next time.

rgrds

Thomas


www.3daybreaker.blogspot.com

Orca V4.4 rebuild to Ramps with Mk8 and E3D, as well as a Rostock Delta Mini and an OLO in backorder :-)
Re: Positioning problem on the bed
November 14, 2013 03:57PM
Although I am aware that this thread is fairly old, I will just add something to it for those who have the same problem and arrive here trough google but cannot use the above solution (like me).

To fix this, you could also write a script that calculates the appropiate centers and dynamically inputs this in slic3r.
The stl info can be gathered with admesh (in ubuntu install with: "sudo apt-get install admesh")

gcode.sh (assuming that there are two stl files, say file_a.stl and file_l.stl, call with "bash gcode.sh file.stl")
#!/bin/bash

FOLDER=$(dirname $1);
FILE=$(basename $1);
FILENAME="${FILE%.*}"

admesh $FOLDER/$FILENAME"_a.stl" >> $FOLDER/$FILENAME"_a.txt"
admesh $FOLDER/$FILENAME"_l.stl" >> $FOLDER/$FILENAME"_l.txt"

POS=$(python stl_position.py $FOLDER/$FILE)
read AX AY LX LY <<< $POS

slic3r -load ~/.Slic3r/filament/a.ini -load ~/.Slic3r/print/a.ini -load ~/.Slic3r/printer/a.ini -o $FOLDER/$FILENAME"_a.gcode" -print-center $AX","$AY $FOLDER/$FILENAME"_a.stl"
slic3r -load ~/.Slic3r/filament/l.ini -load ~/.Slic3r/print/l.ini -load ~/.Slic3r/printer/l.ini -o $FOLDER/$FILENAME"_l.gcode" -print-center $LX","$LY $FOLDER/$FILENAME"_l.stl"



stl_position.py
from __future__ import division
import sys
import os


def center_position(input_file):
	content = open(input_file, "r").read()		#open file and read content into variable
	ind= [content.find('Min X'), content.find(', Max X'), 
	content.find('Max X'), content.find('Min Y'), 
	content.find('Min Y'), content.find(', Max Y'),
	content.find('Max Y'), content.find('Min Z')]
	
	xmin=float(content[ind[0]+8:ind[1]])
	xmax=float(content[ind[2]+8:ind[3]-1])
	ymin=float(content[ind[4]+8:ind[5]])
	ymax=float(content[ind[6]+8:ind[7]-1])

	
	xcen = ((xmax-xmin)/2)+xmin
	ycen = ((ymax-ymin)/2)+ymin

	return [xcen, ycen]


input_file=sys.argv[1] 
filename, ext = os.path.splitext(input_file)

a = center_position(filename+"_a.txt")
l = center_position(filename+"_l.txt")

print a[0],a[1],l[0],l[1]
Sorry, only registered users may post in this forum.

Click here to login