Browse the docs

betti render

Draw meshes as a picture: PNG, PDF, EPS or SVG.

No licence required No sign-in needed.

Usage

Shell
betti render [flags] mesh ... out

Draws meshes as a picture, ray traced on the processor: faces shaded by the light of a sky and a lamp, with shadows, their edges drawn as lines: all, the features (creases, open edges, silhouettes and a CAD model's face boundaries), or, by default, all where the faces are large enough on the picture for them to read and the features where not. Seen orthographically and whole, the edges are found by hidden-line removal and kept as lines, so that PDF, EPS and SVG hold them as vectors. Each mesh is a panel; several make a sheet, side by side or in a grid, seen by one camera so that they compare (-fit each frames each on its own). With -overlay they are drawn together in one panel, each in its own colour.

A mesh is any surface mesh, a volume mesh (its cells' faces), or, with the cad module, a CAD model (its faces' boundaries as edges). -color colours faces by what they are or what they carry, with a legend: parts, the regions or tags a file gives its faces (as CAD faces from cad mesh), a measure of quality, or a value the file holds at its vertices or faces, such as the distance verify -map writes. -cut cuts through the meshes, taking away what is on the camera's side; a volume mesh is cut through whole cells, so that its cells show.

In a script this is render(…), its flags as keywords; for coding agents, the tool render.

Examples

Shell
betti render part.stl part.png
betti render -view top -color angle even.obj angles.png
betti render -color deviation -range -0.05,0.05 deviation.vtu deviation.png
betti render -fit each -columns 6 parts/*.stl sheet.png
betti render -cut z=10 -color jacobian part.msh cells.png
betti render -width 2100 -height 1500 -dpi 600 -color angle even.obj figure.pdf
betti run part.stl even.obj fix repair + mesh remesh -size 1% + render even.png

Colours (-color)

noneone colour; in an overlay, each mesh its own (the default)
partseach connected part its own colour
regionseach region its own colour: a surface's face regions, as CAD faces from cad mesh, or a volume mesh's regions
tagsa volume mesh's boundary faces by their tags
faces, bodiesa CAD model's faces, or its bodies
angleeach face's smallest corner angle, in degrees
jacobianeach face's or cell's scaled Jacobian at its worst corner, 1 at best
non-orthogonalityeach polyhedral cell's worst non-orthogonality, in degrees
NAMEa value the file holds at vertices or faces, by its name, as deviation or thickness

Formats, by the extension of out

.epsEncapsulated PostScript, for LaTeX with dvips: the picture as an image laid over white, titles and legend as lines
.pdfa page for a paper: the picture as a lossless image, titles and legend as lines, sharp at any size
.pngpixels, with their resolution (-dpi)
.svgfor the web and drawing programs: the picture as an image, titles and legend as lines

Flags

FlagTakesDefaultMeaning
-backgroundtextwhitewhite, none (clear), or a colour as #rrggbb
-boxlength or numbernonefit the camera to this region instead, as minX,minY,minZ,maxX,maxY,maxZ
-colortextnonewhat colours faces: none, parts, regions, tags, faces, bodies, angle, jacobian, non-orthogonality, or the name of a value the file holds
-columnsintegerup to four in a row, more in a grid near squarepanels in a row
-cutlength or numbernonecut by a plane, z=10, or a point and a normal as px,py,pz,nx,ny,nz, taking away what is on the camera's side
-dpinumber300dots an inch: the size a page gives the picture, as a PDF, EPS or SVG page's or a PNG's
-edgestextautowhich edges are drawn: all, the faces' own; features, where faces meet at 30° or more, open edges, silhouettes and a CAD model's face boundaries; auto, all where the faces are large enough on the picture for them to read, else the features; none
-fittextallall: one camera for every panel, so that they compare; each: each panel framed on its own
-heightinteger900each panel's height, in pixels
-legendswitchtruedraw what the colours mean under the picture
-linenumber1the width of edges, in pixels
-overlayswitchoffdraw all the meshes together in one panel, each in its own colour
-perspectivenumbernoneview in perspective, with this vertical field of view in degrees (0: orthographic)
-rangelength or numberthe values' own, either side of zero alike when they straddle itthe range of values coloured, as min,max
-samplesinteger16samples a pixel averages: more for smoother shading and edges, fewer for speed
-titlesswitchwhen there are severalwrite each panel's name above it
-updirection+zthe direction up in the picture: +z, -y, or x,y,z
-viewlength or numberiso: front, right and abovewhere the camera looks from: iso, front, back, left, right, top, bottom, or a direction x,y,z toward the camera
-widthinteger1200each panel's width, in pixels
-zoomnumber1magnify beyond fitting the meshes

Output flags

FlagTakesDefaultMeaning
-jsonswitchoffprint the result as JSON
-qswitchoffprint nothing but errors
-skipnamesnoneswitch off steps of the work by their names, separated by commas, as the built-in help lists them
-vswitchoffalso show the stages of each step, and their times

This page is generated from betti help render. Lengths are absolute, or a percentage of the part's bounding-box diagonal, as in -size 1%.