blending - Creation of surface between outlines
This module focuses on automated envelope generations, based on interface outlines.
The user has only to define the interface outlines or surfaces to join, and the algorithm makes the surface. No more pain to imagine some fancy geometries.
Formal definitions
interface: | a surface or an outline (a loop) with associated exterior normals. |
---|---|
node: | a group of interfaces meant to be attached together by a blended surface. |
In order to generate envelopes, this module asks for cutting all the surfaces to join into ‘nodes’. The algorithm decides how to join shortly all the outlines in a node. Once splited in nodes, you only need to generate node junctions for each, and concatenate the resulting meshes.
Details
The blended surfaces are created between interfaces, linked as the points of a convex polyedron of the interfaces directions to the node center.
Example
>>> x, y, z = vec3(1, 0, 0), vec3(0, 1, 0), vec3(0, 0, 1)
>>> # 1. A surface can be passed: the surface outlines and
>>> # normals will be used as the generated surface tangents
>>> # 2. Wire or primitives can be passed: the wire loops are used
>>> # and the approximate normal to the wire plane
>>> # 3. More parameters when building directly the interface
>>> m = junction(
... extrusion(2 * z, web(Circle((vec3(0), z), 1))), # 1.
... Circle((2 * x, x), 0.5), # 2.
... (Circle((2 * y, y), 0.5), "tangent", 2.0), # 3.
... generate="normal",
... )
To come in a next version
>>> # create junction for each iterable of interface,
>>> # if some are not interfaces, they are used
>>> # as placeholder objects for auto-determined interfaces
>>> multijunction(
... (surf1, surf2, 42, surf5),
... (42, surf3, surf4),
... generate='straight',
... )
General mesh generation
-
junction
(*args, center=None, tangents='normal', weight=1.0, match='length', resolution=None)[source] Join several outlines with a blended surface
- tangents:
- ‘straight’ no interpolation, straight lines ‘normal’ interpolated surface starts normal to the interfaces ‘tangent’ interpolated surface starts tangent to the interfaces
- weight:
- factor applied on the tangents before passing to
interpol2
orintri_smooth
the resulting tangent is computed in pointa
asweight * distance(a,b) * normalize(tangent[a])
- match:
- ‘length’ share the outline between 2 matched points to assign the same length to both sides ‘corner’ split the curve to share around a corner
- center:
- position of the center of the junction node used to determine connexion between interfaces can be usefull for particularly weird and ambiguous interfaces
Note
match method ‘corner’ is not yet implemented
-
blendloop
(interface, center=None, tangents='tangent', weight=1.0, resolution=None) Mesh [source] Blend inside a loop interface
see
junction
for the parameters.