slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.33k stars 1.29k forks source link

Starting position of loop is often the same #3069

Open mrvn opened 8 years ago

mrvn commented 8 years ago

I'm printing a box (basically a hollow cube split in half to give box and lid). The simplicity of the box means that there are many identical slices and the slicer picks the same start position for the perimeter (and other loops) for every slice. SInce the starting/ending position is never perfect this leaves a noticable weld/seem on one side of the box going up/down and prefents the lid from fitting on te box in my case. I have to sand off the weld to make it fit.

I tried setting "Seem position: Random" but that doesn't seem to have the desired effect.

PS: Whenn using a thicker shell all the shell loops also start at the same position (as well as the perimeter) since it starts each new loop exactly where the old one ends. It should start the next loop a short distance away from the last to avoid concentrating any error or weak point at the same spot. Maybe that's the same problem.

alranel commented 8 years ago

@Vicious-one, can you make a pull request for this? I'd like to keep your name in commit history.

bubnikv commented 8 years ago

The old C++ line

last_pos.rotate(rand() % 2_PI, centroid); was replaced by last_pos.rotate(fmod((float)rand()/16.0, 2.0_PI), centroid);

The correct solution to get a random angle in <0,2_PI) is 2.0_PI *float(rand())/float(MAX_INT)

Vojtech