Repository navigation
Getting the points inside a mesh #7560
Replies: 1 comment 12 replies
|
I'd switch to inside = []
for i in range(pnts.shape[0]):
p = mm.Vector3f(float(pnts[i, 0]), float(pnts[i, 1]), float(pnts[i, 2]))
inside.append(not mesh.isOutside(p)) # defaults: windingNumberThreshold=0.5, beta=2
ids = tt.where(tt.tensor(inside))[0]
If you still see stray points with |



I'd switch to
mesh.isOutside(p)for this. It uses the generalized winding number, so you don't need the projection at all:isOutsideByProjNormdecides the sign from just one direction: the pseudonormal at the closest point (face normal, edge normal or angle-weighted vertex normal, depending on where the projection lands). If that single normal is off, every grid point whose closest point lands there flips sign together, which would explain the lit…