Basics
This section provides a bottom-up description of the basic concepts behind queddy. It's a journey from simple triangles to an HTTP API accessible through the internet.
Triangles – queddy's basic graphics primitives
Triangles are simple, efficient to render onto the screen, and easy to post process for further needs (e.g. to control 3D printers). queddy uses the boundary representation (B-rep) method with triangles as basic graphics primitives to represent the shapes of three-dimensional objects.
Polygonal and subdivision surfaces – queddy's containers for triangles
Although queddyprovides the possibility to define each triangle explicitly, in most cases triangles are better automatically derived from a higher level of abstraction – in queddy's case from polygonal surfaces (Fig. 1) or subdivision surfaces (Fig. 2).
Fig. 1: polygonal surface
Fig. 2: subdivision surface
Polygonal surfaces are flat and can have rings (i.e. inner face boundaries, e.g. for holes). The surface and ring boundaries are defined by vertices and their connecting sharp edges. queddy computes a set of triangles which fulfills these constraints.
Subdivison surfaces are free form surfaces which are defined by a control mesh. The control mesh consists of vertices and their connecting sharp or smooth edges. queddy computes the corresponding set of triangles by processing several subdivision steps on the control mesh.
B-rep mesh – queddy's basic data structure
queddy's B-rep mesh integrates the control data for polygonal surfaces and subdivision surfaces in one common data structure. It contains vertices, edges, and faces in addition to information about the relationship among themselves.
The following properties of vertices, edges, and faces can be defined by the user directly:
- position of a vertex: x, y, z, w coordinates
- sharpness of an edge: "smooth" or "sharp"
- material of a face: string id of a material definition
Additionally, some topological relationship information is automatically generated and stored to navigate through the mesh:
- next edge of an edge: to navigate alongside a face boundary
- next ring of a face or ring: to navigate through all rings of a face
- baseface of a face or ring: to navigate back to a ring's baseface
Finally, the orientation of faces is defined by convention and follows the right-hand rule: faces are surrounded by their bounding edges in counter-clockwise direction.
Here is an example illustrating how different combinations of sharp (red) and smooth (green) edges in queddy's B-rep mesh result in different face shapes:
Fig. 3: face shapes as result of sharp and smooth edges
In particular, these are:
- the yellow face at the bottom: A purely polygonal face. All its vertices are corner vertices, i.e. they belong to at least 3 sharp edges.
- the blue faces at the front, back and left sides: Sharp faces with at least one crease vertex which belongs to 2 sharp edges (and an arbitrary number of smooth edges). In this case, the real face boundary is generated by subdivision of the 2 sharp edges. The front and back faces each have a ring. They are displayed a bit transparent to show the otherwise partly invisible B-rep mesh of the hole consisting of the two rings and their connecting faces. For the rings the same rules apply regarding corner and crease vertices.
- the purple face at the right side: An almost purely smooth face. Why "almost"? Smooth faces have in their boundaries only smooth edges and smooth vertices which again belong to only smooth edges. But, for demonstration reasons, one of the vertices is a dart vertex which has 1 sharp edge. It generates a crease edge which exactly disappears at the point where the smooth face starts.
- all other (uncolored) faces: Something in between. But, they are all subdivision surfaces because they each have at least one smooth edge in their face boundaries.
Excursus: halfedges – queddy's unique positions in the B-rep mesh
queddy implements the concept of halfedges. A typical edge connects two vertices and belongs to two faces. queddy splits every edge in two halfedges, each assigned to one of the two vertices and one of the two faces. These combinations of one vertex and one face are unique and therefore represent unique positions in the B-rep mesh.
Fig. 4: one halfedge (e16: right vertex, blue face) ...
Fig. 5: ... the other halfedge (e17: left vertex, yellow face)
The relationship between two associated halfedges is defined by convention: each even integer id and its successor belong to the two halfedges of one edge (e.g.: e0/e1, e2/e3, e16/e17, e42/e43, ...).
Notes:- It is possible to create "degenerated" edges which have only one vertex or belong to only one face, but an edge never has more than two vertices or belongs to more than two faces.
- The terms "edge" and "halfedge" are used synonymously. Always, if the "direction" of the edge is important – it is meant as a halfedge.
Euler operators – queddy's small set of B-rep mesh manipulators
Euler operators are a closed and complete set of operators for mesh manipulation which – at any time – leave a topologically correct B-rep mesh. More details about queddy's actual implementation of Euler operators can be found here.
Python – queddy's scripting language
queddy's Euler operators and some further supporting functions are provided through a Python API (see here for details). This makes queddy a generative modeling tool where the shapes of three-dimensional objects are rather programmed than drawn.
HTTP API – queddy's access point in the internet
queddy is designed to be accessed via the internet. The Python model code is sent to the URL of queddy's modeling kernel which returns a 3D model in the requested format (e.g. X3D, STL, OBJ, glTF).
