pipeline
pleat.shrink_rotate.pipeline ¶
Build a shrink-rotate crease pattern from a tiling.
This is the high-level pipeline:
- Compute the reciprocal figure of
G(per-face rotation centers). - Apply the :func:
pleat.conway.shrink_rotate_graphConway operator to subdivide each face. - Rotate and scale each twist face around its rotation center.
- (Optional) assign mountain/valley creases based on the
:data:
pleat.shrink_rotate.crease_orientation.THIS_WAYmark.
The single public entry point is :func:shrink_rotate_pattern.
shrink_rotate_pattern ¶
shrink_rotate_pattern(
G: GeometricHEG,
alpha: float = np.pi / 5,
factor: float = 0.5,
*,
assign_creases: bool = True,
simplify_boundary: bool = True,
**reciprocal_figure_kwargs
) -> EuclideanPositionHEG
Build a shrink-rotate crease pattern from tiling G.
Each face of G is subdivided by the shrink-rotate Conway operator; the central polygon of every face is rotated by alpha and scaled by factor around the corresponding reciprocal-figure center.
Parameters¶
G:
Input tiling. If it does not yet have 'reciprocal_pos'
attributes, the reciprocal figure is computed (and cached).
alpha, factor:
Shrink-rotate parameters in radians and as a ratio. The default
alpha=π/5, factor=0.5 is a generic flat-foldable choice.
assign_creases:
When True (the default), additionally call
:func:assign_shrink_rotate_creases, populate 'color_key'
attributes for rendering, and emit a Kawasaki-sum sanity warning.
Set to False to obtain only the bare topology + positions.
simplify_boundary:
When True (and assign_creases is True), remove order-2 vertices
introduced on the boundary by the operator.
**reciprocal_figure_kwargs:
Forwarded to :func:reciprocal_figure if a recomputation is
triggered.
Source code in pleat/shrink_rotate/pipeline.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
assign_shrink_rotate_creases ¶
Set MOUNTAIN/VALLEY creases on a shrink-rotate crease pattern.
The assignment is driven by the
:data:~pleat.shrink_rotate.crease_orientation.THIS_WAY halfedge
marks on the original graph (i.e. on the 'pre_conway' faces of
each twist face): on each interior edge of the original tiling, the
side carrying THIS_WAY indicates which neighbouring face lies above
in the folded model.
For each twist face this routine walks around its boundary in parallel with the corresponding boundary of the original face. Where THIS_WAY marks the original edge, the four halfedges of the corresponding quad in the SRG are assigned MOUNTAIN/VALLEY in a fixed pattern that produces a valid flat fold.
Border halfedges are cleared of any spurious assignment, and each interior edge is made consistent across its two halfedges.
The function expects THIS_WAY to be set externally — see the
helpers in :mod:pleat.shrink_rotate.crease_orientation for ways to
derive it from the geometry of the original tiling.