pdf drawing empty
Created by: reiniervandijk
Using the YADD example to generate a PDF, results in an empty drawing
(gdl::with-format (pdf "/tmp/box.pdf" :view-transform (getf *standard-views* :trimetric))
(write-the-object (make-instance 'box :length 100 :width 100 :height 100) cad-output))
Imported comments:
By genworks on 2013-03-09 17:11:45 UTC
Thanks for this. This example needs to be fixed, since PDF output-format is only supported for 2D objects such as drawings. The box would have to be contained in a view of a drawing first, then the
(with-format (pdf ...) (write-the cad-output))
would be called on the drawing.
This issue will remain open until the documentation is fixed, or until the PDF output-format is upgraded to produce a default drawing with default view when called on a 3D object (if we were to do that, what would make sense for the default view? I would hesitate to put a bunch of view options into the PDF output-format, because at that point it would be better simply to make a drawing and specify the viewing details).
Stylistic note: use of double-colon is not recommended unless going for unexported symbols in an unused package for experimental purposes. In this case you would likely be in-package :gdl-user or another package created with gdl:define-package or gwl:define-package, so the prefix is not necessary. If you are working in a package which does not use the GDL packages, then you should prefix with a single-colon, and you would have to prefix the name of the output format as well, e.g.
(gdl:with-format (geom-base:pdf ... ) ... )
By reiniervandijk on 2013-03-09 17:41:39 UTC
Note that I'd just copied the example from YADD. The example uses the double-colon notation, I personally wouldn't do such a thing. Default view can be trimetric, like you've done before.