Skip to content

Commit

Permalink
improve example comparison in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
moehriegitt committed Oct 30, 2018
1 parent d1bd8c8 commit d7ee909
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 22 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,12 @@ time ./hob3l.exe scad-test/test31b.scad -o test31b.stl

This is 250 times faster. The difference is of course that with
Hob3l, the result is sliced into layers, as the following image
demonstrates.
demonstrates. The top is the OpenSCAD F6 view, the bottom is Hob3l's
WebGL output in my web browser.

![Hob3l output](img/test31b.jpg)
![OpenSCAD output](img/test31b-openscad.jpg)

![Hob3l output](img/test31b-hob3l.jpg)

## Supported Output Formats

Expand Down Expand Up @@ -460,14 +463,17 @@ sys 0m0.044s

The difference of the conversion technique is visible in the model
view of the STL, where the 2D CSG slicing technique clearly shows the
layers:
layers, e.g. for a real-life example sliced a 0.2mm with Hob3l. The
top is OpenSCAD's output in Slic3r, the bottom is Hob3l's output in
Slic3r:

![OpenSCAD model](img/useless-model-openscad.jpg)
![Hob3l model](img/useless-model-hob3l.jpg)

The final result of the slicer, however, is indistinguishable (I was
unable to replicate the exact same view, so the Moiré patterns are
different -- but the result is really the same):
unable to replicate the exact same view, so the Moiré patterns
are different -- but the result is really the same), again OpenSCAD
output top, Hob3l bottom:

![OpenSCAD preview](img/useless-preview-openscad.jpg)
![Hob3l preview](img/useless-preview-hob3l.jpg)
Expand Down
Binary file added img/test31b-hob3l.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test31b-hob3l.xcf
Binary file not shown.
Binary file removed img/test31b.jpg
Binary file not shown.
Binary file removed img/test31b.xcf
Binary file not shown.
26 changes: 13 additions & 13 deletions scad-test/test31b.scad
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ color("mediumturquoise") {
translate([0,10,0])
scale([2,1,0.5])
color("red")
sphere(10, $fn=7);
sphere(10, $fn=70);
cube(10);
translate([10,0,0])
color("yellow")
cube([1,1,20]);
}
color([0.5, 0.5, 1]) {
rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 30,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 60,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 90,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(120,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(150,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(180,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(210,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(240,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(270,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(300,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(330,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 30,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 60,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 90,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(120,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(150,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(180,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(210,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(240,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(270,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(300,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(330,[1,0,0]) rotate([170,30,160])translate([0,0,15])scale([2.3,1.5,5.2])sphere(2,$fn=99);
}
25 changes: 25 additions & 0 deletions scad-test/test31c.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
color("mediumturquoise") {
rotate([30,20,0])
translate([0,10,0])
scale([2,1,0.5])
color("red")
sphere(10, $fn=7);
cube(10);
translate([10,0,0])
color("yellow")
cube([1,1,20]);
}
color([0.5, 0.5, 1]) {
rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 30,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 60,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate( 90,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(120,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(150,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(180,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(210,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(240,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(270,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(300,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
rotate(330,[1,0,0]) rotate([170,30,160])translate([0,0,25])scale([2.3,1.5,5.2])sphere(2,$fn=99);
}
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ int main(int argc, char **argv)
opt.tree.layer_gap = -1;
opt.tree.max_simultaneous = CP_CSG2_MAX_LAZY;
opt.tree.optimise = CP_CSG2_OPT_DEFAULT;
opt.tree.color_rand = 15;
opt.tree.color_rand = 0;
opt.verbose = 1;

/* parse command line */
Expand Down
2 changes: 1 addition & 1 deletion src/opt.inc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static char const *opt_help =
"JavaScript/WEBGL Output Options\n"
" --js-color-rand=ARG\n"
" How much to randomise colors in CSG2 algorithm to make the result\n"
" easier to grasp (default: 15, valid: 0..255). \n"
" easier to grasp (default: 0, valid: 0..255, good start: 15). \n"
"PostScript Output Options\n"
" --ps-scale-fit\n"
" for --dump-ps: expand to fit normal bounding box to page\n"
Expand Down
2 changes: 1 addition & 1 deletion src/opt.switch
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ help_section "JavaScript/WEBGL Output Options";

case "js-color-rand": uint8 &opt->tree.color_rand{
"How much to randomise colors in CSG2 algorithm to make the result";
"easier to grasp (default: 15, valid: 0..255). ";
"easier to grasp (default: 0, valid: 0..255, good start: 15). ";
}

help_section "PostScript Output Options";
Expand Down
3 changes: 2 additions & 1 deletion test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ TEST_TRIANGLE.scad := \
TEST_STL.scad := \
scad-test/uselessbox+body.scad \
scad-test/curry.scad \
scad-test/test31b.scad
scad-test/test31b.scad \
scad-test/test31c.scad

0 comments on commit d7ee909

Please sign in to comment.