-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should .csg format store camera data? #4398
Comments
Well, $fn makes it in (in place at built-in calls), and $t makes it in (evaluated numerically). I then contemplated whether we should consider csg simply what is needed to describe a model, or if it is also designated to describe images to be produced and the contents of preview. The evidence that it is supposed to describe images and preview content is that color is included and also convexity arguments are carried along, none of which have any impact on render results. Therefore, csg output is already designed to reproduce things that only apply to the preview display and to producing an image output, except that apparently we do not carry along the camera information. Therefore I would say, yes, it seems appropriate to me that camera data should also be a part of this content. I suspect it was omitted because we are not carrying any other top-level variable assignments along, as they are all evaluated. But I conducted a test and added camera information back into a csg output file, then loaded it, and it was processed correctly utilizing the camera information set at the top. So if we dump it in there, we can already reload it just fine. I think I'm inclined to say that specific camera data variables should be added to the csg output if and only if they have a manually specified value in the input scad file. |
I would say that we include color not because we want to support preview, but rather because color is part of the definition of the model. The fact that it's only supported in preview is not a "frill" of preview, but rather a missing feature of render. Note that we do not record places where you set $fn and its friends. Rather, we record places where they are consumed. |
And circle() will record $fn and its friends whether or not you set them. |
There is an issue with a test named
csgpngtest_logo_and_text
. This test is not part of the default test suite, so is not tested by CI servers, but can be tested manually withctest -C All
.The
csgpngtest
test type basically exports to .csg, then starts another instance of OpenSCAD importing the csg, and exports an image from that. Finally this is compared with the expected image forcgalpngtest
, which comes from a normal CGAL render to PNG.The problem this causes for
logo_and_text.scad
is that it has$vp*
variables set in the.scad
file to define the camera position, that means if you generate expected image fromcgalpngtest_logo_and_test
, then imported .csg version fails.Alternatively if one were to update the expected results based on
csgpngtest_logo_and_text
, then thecgalpngtest
will fail.If its not something anyone cares very strongly about, then the quick fix for this would be to add
csgpngtest_logo_and_text
to the list of disabled tests intests/CMakeLists.txt
openscad/tests/CMakeLists.txt
Lines 741 to 807 in 2d27703
The text was updated successfully, but these errors were encountered: