profiles
pleat.intersecting_cylinders.profiles ¶
Profile curves used by the intersecting-cylinders pattern.
A :class:Profile describes the cross-section of the curved triangles that sit
on the edges of the input tiling. It stores arc-length-parametrised samples of
a height function fn(x) for x in [0, 1], normalised so that the total
arc length equals 1.
The cross-section is interpreted differently by the 2D pipeline (which produces
the crease pattern in :mod:pleat.intersecting_cylinders.pipeline) and by the
3D mesh builder (:mod:pleat.intersecting_cylinders.mesh3d):
- In 2D,
profile.tis the perpendicular coordinate of the crease andprofile.lthe along-edge arc-length coordinate.profile.t = 0corresponds to the vertex side of the half-triangle andprofile.t = sfto the face/incenter side. - In 3D, the same height function is re-used but read from the apex end
inwards so that the spike forms at the vertex; see
:func:
pleat.intersecting_cylinders.mesh3d._spike_depth_from_profile.
Profile
dataclass
¶
Arc-length-parametrised cross-section curve.
The cross-section is the curve (x, fn(x)) for x in [0, 1], where
fn(0) = 0 and fn is non-negative. Samples are simplified by the
Ramer-Douglas-Peucker algorithm and stored after rescaling so that the
total arc length is 1 (and the perpendicular extent is therefore
shrink_factor = 1 / unscaled_arc_length <= 1).
Attributes:
| Name | Type | Description |
|---|---|---|
t |
NDArray[float64]
|
Perpendicular coordinate, scaled to |
l |
NDArray[float64]
|
Arc length along the curve, scaled to |
y |
NDArray[float64]
|
Height |
shrink_factor |
float
|
|
from_function
classmethod
¶
from_function(
fn: Callable[[NDArray[float64]], NDArray[float64]],
n_samples: int = 1000,
rdp_tol: float = 0.0001,
) -> "Profile"
Build a :class:Profile from a height function fn on [0, 1].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fn
|
Callable[[NDArray[float64]], NDArray[float64]]
|
Height function with |
required |
n_samples
|
int
|
Number of samples used before RDP simplification. |
1000
|
rdp_tol
|
float
|
Ramer-Douglas-Peucker tolerance used to simplify the
|
0.0001
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
'Profile'
|
class: |
Source code in pleat/intersecting_cylinders/profiles.py
plot ¶
Plot the simplified (t, y) polyline.
circular_profile ¶
Quarter-ellipse cross-section y = scale * sqrt(1 - (1 - x)**2).
With scale = 1 this is the canonical quarter-circle and produces
intersecting half-cylinders for the platonic 4 and 3 tilings. Larger
values of scale make the bumps taller and steeper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scale
|
float
|
Height multiplier on the quarter-circle. |
1.3
|
n_samples
|
int
|
Forwarded to :meth: |
1000
|
rdp_tol
|
float
|
Forwarded to :meth: |
0.0001
|
Source code in pleat/intersecting_cylinders/profiles.py
parabolic_profile ¶
Parabolic cross-section y = scale * (1 - (1 - x)**2).
This is a smoother curve than the circular profile, with zero slope at the start and a more gradual approach to the maximum height. The resulting crease pattern is less spiky and may be easier to fold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scale
|
float
|
Height multiplier on the parabola. |
1.3
|
n_samples
|
int
|
Forwarded to :meth: |
1000
|
rdp_tol
|
float
|
Forwarded to :meth: |
0.0001
|