To focus the search input from anywhere on the page, press the 'S' key.
in-package search v0.1.0
Library
Module
Module type
Parameter
Class
Class type
Exporting .scad
scripts through the OpenSCAD command line interface.
2D/3D formats
val script : string -> string -> (unit, string) result
script out_path in_path
Export the .scad
script at in_path
to a file at the given out_path
, in a format dictated by the extension of out_path
. See documentation for the -o
argument in the OpenSCAD CLI docs for available output formats. If export fails, an error containing captured Stderr output from OpenSCAD is returned (usually CGAL errors).
Images (PNG)
type camera =
| Auto
(*Automatically positon to view all of the object, and point at it's centre.
*)| Gimbal of {
translation : OCADml.v3;
(*origin shift vector
*)rotation : OCADml.v3;
(*euler rotation vector (about translated origin)
*)distance : [ `Auto | `D of float ];
(*vertical distance of camera above shifted origin before rotation (auto moves far enough away to bring object fully into frame)
*)
}
| Eye of {
lens : OCADml.v3;
(*lens position vector
*)center : OCADml.v3;
(*center position vector (which lens points towards)
*)view_all : bool;
(*override vector distance to ensure all object is visible
*)
}
Camera position and orientation configuration
val auto : camera
Position camera such that object is centred and fully in view.
gimbal ?translation ?rotation d
Position and orient the camera as in the OpenSCAD GUI with translation
, and euler rotation
vectors a (defaulting to V3
.zero). The focal point is moved from the origin by translation
, then the camera is positioned the distance d
(manually, or far enough back to get the whole object into frame) straight upward in z before applying the euler rotation
.
eye ?view_all ?center lens
Position the camera at lens
, and point it at center
. If view_all
is true
, then the camera will be moved along the difference vector to bring the whole object into the frame.
val snapshot :
?render:bool ->
?colorscheme:colorscheme ->
?view:view list ->
?projection:projection ->
?size:(int * int) ->
?camera:camera ->
string ->
string ->
(unit, string) result
snapshot ?render ?colorscheme ?view ?projection ?size ?camera out_path in_path
Save an image (PNG only at this time) of size
pixels (default = (500, 500)
) to out_path
of the object defined by the .scad
script located at in_path
using the OpenSCAD CLI. By default, the camera
is positioned automatically to point at the centre of the object, and far enough away such for it to all be in frame. See camera
and its gimbal
and eye
constructors for details on manual control. If export fails, an error containing captured Stderr output from OpenSCAD is returned (usually CGAL errors).
- if
render
istrue
, the object will be rendered before the snapshot is taken, otherwise preview mode is used (default =false
). view
toggles on various viewport elements such as axes and scale ticksprojection
sets the view style as in the GUI (default =Perspective
)colorscheme
selects the OpenSCAD colour palette (default =Cornfield
)
File extension helpers
Set of 3D output format file extensions: ".stl"
, ".off"
, ".amf"
, ".3mf"
, ".csg"
, ".wrl"