Closed Achillx closed 5 years ago
nice bug report :) will get right on it...
there was indeed something wrong with the scheme: it only worked for closed meshes. should be fixed since 6e5e0e3
i have tested the following successfully:
from compas.datastructures import Mesh
from compas.topology import trimesh_subdivide_loop
from compas.plotters import MeshPlotter
points = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.5, 1.0, 0.0]]
faces = [[0, 1, 2]]
mesh = Mesh.from_vertices_and_faces(points, faces)
subd = trimesh_subdivide_loop(mesh, k=3)
plotter = MeshPlotter(subd, figsize=(10, 7))
plotter.draw_vertices(radius=0.1)
plotter.draw_faces()
plotter.show()
from compas.datastructures import Mesh
from compas.geometry import pointcloud_xy
from compas.topology import delaunay_from_points
from compas.topology import trimesh_subdivide_loop
from compas.plotters import MeshPlotter
points = pointcloud_xy(10, (0, 100))
faces = delaunay_from_points(points)
mesh = Mesh.from_vertices_and_faces(points, faces)
subd = trimesh_subdivide_loop(mesh, k=3)
plotter = MeshPlotter(subd, figsize=(10, 7))
plotter.draw_vertices(radius=0.1)
plotter.draw_faces()
plotter.show()
however, higher numbers of starting points in the pointcloud seem to sometimes generate overlaps... the algorithm is also clearly not yet optimised for speed :)
Yes, that fixed it!
Describe the bug The function returns exception:
To Reproduce Steps to reproduce the behavior:
Expected behavior To return a subdivided mesh.
Desktop (please complete the following information):