11from itertools import filterfalse
2+ from pathlib import Path
3+
24from compas .colors import Color
35from compas .datastructures import Mesh
46from compas_viewer import Viewer
1214from tessagon .types .dodeca_tessagon import DodecaTessagon
1315from tessagon .types .floret_tessagon import FloretTessagon
1416from tessagon .types .hex_big_tri_tessagon import HexBigTriTessagon
15-
1617from tessagon .types .hex_tessagon import HexTessagon
1718from tessagon .types .hex_tri_tessagon import HexTriTessagon
1819from tessagon .types .octo_tessagon import OctoTessagon
2728from compas_libigl .mapping import map_mesh
2829from compas_libigl .parametrisation import trimesh_lsc_mapping
2930
30- from pathlib import Path
31-
32-
3331TESSAGON_TYPES = {
3432 1 : ("Hex" , HexTessagon ),
3533 2 : ("Tri" , TriTessagon ),
6866
6967v , f = mesh .to_vertices_and_faces ()
7068
71-
7269# ==============================================================================
7370# Input geometry: 2D Pattern creation using Tessagon library, can be other mesh.
7471# ==============================================================================
7572
7673options = {
77- "function" : lambda u , v : [u * 1 , v * 1 , 0 ],
74+ "function" : lambda u , v : [u * 1 , v * 1 , 0 ],
7875 "u_range" : [- 0.25 , 1.25 ],
7976 "v_range" : [- 0.25 , 1.25 ],
8077 "u_num" : 20 ,
9996
10097mv , mf = map_mesh ((v , f ), (pv , pf ), clip_boundaries = True , tolerance = 1e-6 )
10198mesh_mapped = Mesh .from_vertices_and_faces (mv , mf )
99+
102100print (len (mv ))
101+
103102# ==============================================================================
104103# Viewer
105104# ==============================================================================
120119 mesh_flattened .vertex_attributes (i , "xyz" , [uv [i ][0 ], uv [i ][1 ], 0 ])
121120viewer .scene .add (mesh_flattened , name = "mesh_flattened" , show_lines = False , opacity = 0.5 )
122121
123- viewer .show ()
122+ viewer .show ()
0 commit comments