CAD and 3D Modeling

Divooka makes 3D models the way it makes everything else: a graph of nodes, each step a node whose result you can see. Change a number and the model follows; leave a step out and the steps after it show what is missing. Make a document from the CAD workload in Divooka Compute - exact solids, surfaces and curves: sketches solved by their constraints, extruded or turned into solids, edges and faces chosen by what they are and filleted, shelled or cut, then sectioned and measured - or in Divooka Explore, which carries the whole CAD workload. Select a node and press F6: the Active Preview's 3D view shows what it made.

Divooka's axes

Divooka has one frame for everything in 3D: +X is the front, +Y the right, and +Z up. The 3D view's Front looks along it with Y to the right and Z up, CAD's words name a solid's sides by it - the right face is the one at +Y - and a model from a program that stands its models Y-up, a glTF among them, is turned to face +X as it is read; 3D Staging's scenes face +X too. A document written before round 27 that names sides means other sides now.

The 3D view's grid

The ground grid belongs to the camera, not to the model: its squares are round numbers of units, its lines are numbered, and the size of a square is written in the corner - Grid 1 unit. Selecting another node leaves it as it is; it steps to larger or smaller squares only as you stand back or come nearer. View › Grid turns it off and on.

Building a model

3D Modeling offers the points, curves, surfaces and solids a model is built from - one Point in a CAD document - and the CAD workload's sketcher solves a 2D sketch by its constraints. A node that is not active says how to see it - Make this node active (Space) and run the document to preview its outputs here. After a compiled run, a step's value is seen by running Interpreted. With nothing selected, what a Routine returns - a model, a picture, a field or a table - is on show, headed by the Routine's name and Returned.

Create Box, objects, cameras and lights have previews of their own, inside Components graphs too, so a scene laid out as Components - 3D Rendering › Scene Composition - is looked at a node at a time. A node that draws in 2D can be shaped by hand in the Active Preview: drag a handle on a drawing to move, size or turn what the node draws, its inputs written as you let go, with Shift keeping a point to one line, a corner its shape and a turn to fifteen degrees at a time; Esc lets go where it was, and each drag is one step of the undo history.

The Architecture toolbox

Architecture, in the CAD workload under Building Elements, builds a house from the parts a person names: Wall, Opening, Door, Window, Slab and Roof. A wall follows a path that lies level on the floor it stands on, centred on it or inside or outside it; a door or a window is placed by a point on the wall that hosts it; a slab fills a footprint; and a roof is Flat, Shed, Gable or Hip, its pitch in degrees, on a rectangle when it is pitched. What cannot be built is refused in its own words - A pitched roof needs a rectangle for its footprint; this one has 5 corners. Make it Flat, or give each wing a roof of its own., An opening 2.5 high on a sill of 0.9 reaches above a wall 2.8 high. The examples are under Architecture Design: A Small House, as a graph of steps and as a Routine, and House from Points, the same two ways.

The Solids toolbox

Solids, in the CAD workload, makes solids by combining shapes, as a constructive solid geometry program does, and answers them as meshes:

Kind Nodes
Shapes Box, Sphere, Cylinder, Spur Gear, Helical Gear
Combining Union, Subtract, Intersect, Union All, Hull
Moving Translate, Rotate, Scale, Mirror
Measuring and writing Volume, Surface Area, Triangle Count, Write OBJ

A box of 4 by 4 by 2 less a cylinder through it is a drilled block: Volume gives what is left, Mesh From Solid turns it into a mesh the 3D view and the other 3D nodes take, and Write OBJ writes it to a file. The Solids nodes run interpreted, compiled and in a published program alike.

The drilled block after a run: Box and Cylinder into Subtract, and the solid it makes into Volume, Mesh From Solid and Write OBJ

The synced view

The 3D view of the Active Preview has a Synced view button - a pointer in a box - that ties the model to the graph: Synced view: select models here and the nodes that made them. While it is on, the pane keeps what it shows, and:

  • a click on the model selects what is under the pointer - on a CAD solid, the face or the edge, outlined - and the node that made it on the canvas, Selected Wall; a click on nothing lets the selection go;
  • a drag selects every model wholly inside the box, and the nodes that made them;
  • Ctrl with a click or a drag adds to the selection, or takes out what is already in it;
  • Alt+drag turns round the model, as a drag does with synced view off, and a middle drag or Shift+drag still moves across it;
  • Esc lets go of the selection, in the view and on the canvas;
  • the other way round, selecting nodes on the canvas tints the models they had a hand in.

Synced view on in A Small House: the front wall picked in the Active Preview's 3D view, outlined, and the Wall node that made it selected on the canvas

Choosing Measure in the view's View menu turns synced view off. Moving a model by dragging it in the synced view, and a door's reveals, are not done yet.

Looking at a 3D file

A 3D file - glTF, OBJ, STL, STEP and some forty kinds more - opens in a tab of its own in Divooka Compute and Divooka Explore, drawn in the same 3D view, and in Methodox 3D Viewer, a program of its own. The Convert 3D Model node turns one kind into another: see File Conversion.