Skip to main content

Module subdivide

Module subdivide 

Source
Expand description

One Catmull–Clark step, with sharp creases: what every face of the cage becomes before its limit surface is built (see crate::limit).

A face of n sides becomes n quads around its face point, each running from one of its corners — that corner’s vertex point — to the edge points on the two sides there. So after one step every face is a quad, whatever the cage was made of, and the limit surface is the same as the cage’s.

The rules, with the mesh’s boundary counted as creased:

  • face point: the average of the face’s corners;
  • edge point: on a creased edge its midpoint, else the average of its two ends and its two faces’ face points;
  • vertex point, by how many creased edges meet at the vertex: none or one (a dart) — (ΣF + ΣE + n(n - 2) V) / n² over its n faces’ face points F and the far ends E of its edges; two — a crease — (A + 6 V + B) / 8 with A, B the creased edges’ far ends; three or more, or a boundary vertex of one face — a corner — stays where it is.

A soft crease, of sharpness s below one (see crate::cage::Crease), is semi-sharp: its edge point is (1 - s) of the smooth rule’s and s of the creased one’s, and a vertex with soft creases is moved (1 - s̄) of the way by the rule counting its sharp creases alone and s̄ by the rule counting the soft ones too, s̄ the mean sharpness of its creases. Its halves are smooth after that: the limit surface rounds off tighter there, without a corner.

Structs§

Subdivided
The mesh after one step: quads only, with where each of its vertices and faces came from.

Enums§

VertexKind
How the surface behaves at a vertex.

Functions§

divide
sum / count, one division per coordinate.
is_sharp
Whether the edge between a and b is sharp: creased, or on the mesh’s boundary.
subdivide
mesh, of topology topology, after one Catmull–Clark step.
vertex_kind
What kind of vertex v is (see VertexKind).
weighted
Σ wᵢ pᵢ for integer weights.