Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Commit Details
Date: | 2011-07-23 20:23:30 (9 years 7 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | 3f820dc41d82c78d972efe3c69f139f209a742f9 |
Message: | cad/test2/README: added more results and cleaned up the text |
Files: |
cad/test2/README (5 diffs) |
Change Details
cad/test2/README | ||
---|---|---|
17 | 17 | New findings and hypotheses |
18 | 18 | =========================== |
19 | 19 | |
20 | The first test revealed several problems in both OpenSCAD and | |
21 | Cadmium. It turned out that most of them could be resolved by making | |
22 | small changes to the models. | |
23 | ||
20 | 24 | |
21 | 25 | The road to hell is paved with good intentions |
22 | 26 | ---------------------------------------------- |
... | ... | |
34 | 38 | Before: 4901.0 4904.4 1.5 8362 3183 |
35 | 39 | After: 316.3 315.9 0.3 2942 1473 |
36 | 40 | |
37 | This makes Cadmium only about 3.7 times slower than OpenSCAD's CGAL | |
41 | This makes Cadmium only about 4-5 times slower than OpenSCAD's CGAL | |
38 | 42 | rendering, a marked improvement from the previous factor of 57. The |
39 | 43 | resulting mesh is now less than half the size of the mesh generated |
40 | 44 | by OpenSCAD. |
... | ... | |
43 | 47 | understandable without these extra tolerances. |
44 | 48 | |
45 | 49 | |
46 | Context: preventing artefacts | |
50 | Background: preventing artefacts | |
51 | -------------------------------- | |
47 | 52 | |
48 | 53 | When subtracting volumes from each other, surfaces that coincide in |
49 | both the original volume and the one subtracted from it, can remain | |
54 | both the original volume and the one subtracted from it can remain | |
50 | 55 | as arbitrarily thin artefacts. |
51 | 56 | |
52 | 57 | This 2D example illustrates the effect: |
53 | 58 | |
54 | - given an original shape A like this | |
59 | - given an original shape like this | |
55 | 60 | |
56 | 61 | +---------------+ |
57 | 62 | | | |
... | ... | |
99 | 103 | +---------+ |
100 | 104 | |
101 | 105 | |
102 | Artefacts in OpenSCAD's mesh may also be rounding errors | |
106 | Artefacts in OpenSCAD's mesh were rounding errors | |
107 | ------------------------------------------------- | |
108 | ||
109 | The artefacts found in the mesh produced by OpenSCAD were also caused | |
110 | by rounding errors. In this case, the problem were parts that were | |
111 | fused along a common surface. As in the above example, this could be | |
112 | solved by making the parts overlap a little. | |
103 | 113 | |
104 | The artefacts found in the mesh produced by OpenSCAD may also be | |
105 | caused from rounding errors. In this case, the problem would be parts | |
106 | that are fused along a common surface. As in the above example, this | |
107 | could be solved by making the parts overlap a little. | |
114 | This change affected the rendering performance as follows: | |
115 | ||
116 | real user system faces vertices | |
117 | Before: 85.5 85.0 0.4 7798 3351 | |
118 | After: 68.8 65.4 0.5 6508 3258 | |
108 | 119 | |
109 | Whether this is truly the source of the artefacts still needs to be | |
110 | verified. | |
120 | The resulting mesh looks as good as the one generated by Cadmium. | |
111 | 121 | |
112 | 122 | |
113 | 123 | OpenCSG problems may be an OpenGL compatibility issue |
... | ... | |
118 | 127 | different color without actually removing them is caused by using |
119 | 128 | OpenGL emulation in Mesa. This needs further investigation. |
120 | 129 | |
130 | ||
131 | Conclusion | |
132 | ========== | |
133 | ||
134 | The model used in the first test contained constructs that were meant | |
135 | to help avoid ambiguous situations. It turned out that Cadmium did | |
136 | not need this "help" and removing the constructs substantially | |
137 | increased the rendering speed. | |
138 | ||
139 | OpenSCAD is the exact opposite: it produces clearly visible | |
140 | artefacts in ambiguous cases and rendering speed also benefits from | |
141 | manual resolution of these issues. The cost of doing so is an | |
142 | increase of the complexity of the model. | |
143 | ||
144 | Performance after the model changes (times are in seconds): | |
145 | ||
146 | real user system faces vertices | |
147 | OpenSCAD: 68.8 65.4 0.5 6508 3258 | |
148 | Cadmium: 316.3 315.9 0.3 2942 1473 | |
149 | ||
150 | The sources of the models used are in | |
151 | http://projects.qi-hardware.com/index.php/p/wernermisc/source/tree/master/cad/test2/ | |
152 | ||
153 | The meshes can be downloaded from | |
154 | http://downloads.qi-hardware.com/people/werner/cad/test2/ | |
155 | ||
121 | 156 | --------------------------------------------------------------------- |
Branches:
master