Closed JeffreyWardman closed 11 months ago
You should extrude a line not a surface in its own plane as this is not a well defined operation, i guess there's no good way to warn a user against that. Maybe in the doc string of extrude() we can add a caveat.
This was working prior to 2023.5.0. I used cut_with_plane
on a mesh and then extrude it in the z-axis.
I don't understand the image you sent, is the surface along the z-axis?
Yes, sorry. It's on an angle from when I was viewing it but it is perfectly parallel to the XY plane.
There's also this example where faces are added. Unfortunately, I can't complete the migration until I/you find what's caused a variation in the extrusion. I'll investigate over the next couple of hours.
OK. Can you provide a mesh and a script to reproduce the issue?
Yep. Give me two hours or so. I'll provide both examples.
I've identified the issue. Now that it's not returning a copy of the vertices, if I take a vertex from .vertices
and manipulate it, then it will also manipulate the mesh's vertices due to pointing to the same array. I'll have to go through my codebase and update to accommodate for the breaking change. Would be good to add this to the documentation as well as a potential side effect.
Will leave it to you, but happy to close the issue.
# Note: Boundaries generated via mesh.clone().boundaries()
import numpy as np
import vedo
boundaries = vedo.load("boundaries.vtk")
zmin_idx = np.argmax(boundaries.vertices[:, 2])
min_height = 1
lowest_pt = boundaries.vertices[zmin_idx] # cloning boundaries here resolves the issue
lowest_pt[-1] = lowest_pt[-1] + min_height
plotter = vedo.Plotter(axes=1)
plotter.show(boundaries)
this is actually not an undesired feature, but i see why it can be confusing..
Yeah, I realised. Will close the issue :)
Extruding a flat surface directly up causes missing faces with 2023.5.0.