Save loading step in trimesh
This commit is contained in:
parent
ac022b3b9b
commit
2f83efdb39
@ -7,6 +7,10 @@
|
||||
have in my notes, then this still lets me split any way I want
|
||||
to without having to worry about joining N boundaries instead
|
||||
of 2, doesn't it?
|
||||
- Note that for this to work right, either gen2mesh has to be
|
||||
called separately on every straight portion, or I have to
|
||||
make a version of gen2mesh that can handle something more
|
||||
like trees of boundaries, not just flat lists.
|
||||
- More complicated: Examples of *merging*. I'm not sure on the theory
|
||||
behind this.
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
17
examples.py
17
examples.py
@ -95,6 +95,23 @@ def ram_horn2():
|
||||
mesh = meshutil.FaceVertexMesh.concat_many(meshes)
|
||||
return mesh
|
||||
|
||||
def branch_test():
|
||||
b0 = numpy.array([
|
||||
[0, 0, 0],
|
||||
[1, 0, 0],
|
||||
[1, 1, 0],
|
||||
[0, 1, 0],
|
||||
], dtype=numpy.float64) - [0.5, 0.5, 0]
|
||||
parts = [meshutil.Transform().scale(0.5).translate(dx, dy, 1)
|
||||
for dx in (-0.25,+0.25) for dy in (-0.25,+0.25)]
|
||||
xf = meshutil.Transform().translate(0,0,0.1).scale(0.95)
|
||||
def gen():
|
||||
b = b0
|
||||
for i in range(10):
|
||||
b = xf.apply_to(b)
|
||||
yield [b]
|
||||
return meshgen.gen2mesh(gen(), close_first=True, close_last=True)
|
||||
|
||||
# Interlocking twists.
|
||||
# ang/dz control resolution. dx0 controls radius. count controls
|
||||
# how many twists. scale controls speed they shrink at.
|
||||
|
||||
@ -66,7 +66,7 @@ def gen_torus_xy(gen, rad=2, frames=100):
|
||||
def gen2mesh(gen, count=0, flip_order=False, loop=False,
|
||||
close_first = False,
|
||||
close_last = False,
|
||||
join_fn=meshutil.join_boundary_optim):
|
||||
join_fn=meshutil.join_boundary_simple):
|
||||
# Get first list of boundaries:
|
||||
bs_first = next(gen)
|
||||
bs_last = bs_first
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user