-
Hi, Here's the example """Set a loop of random points on a sphere
to cut a region of the mesh"""
from vedo import settings, Sphere, Points, show
settings.useDepthPeeling = True
s = Sphere().alpha(0.6).lw(0.1)
# pick a few points on the sphere
sc = s.points()
pts = Points([sc[10], sc[15], sc[129], sc[165]], r=12)
#cut loop region identified by the points
scut = s.clone().cutWithPointLoop(pts, invert=False, on='cells')
scut.c('blue',0.7).lw(0).scale(1.03)
show(s, pts, scut, __doc__, axes=1) This cuts two loops in the mesh - the one defined by the set of points, and a second one on the opposite side of the sphere. Do you know if it's possible to not cut the one on the other side of the sphere? Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
marcomusy
Apr 25, 2022
Replies: 1 comment 1 reply
-
Uhm the two modes work in very different ways.. so it's not obvious.. from vedo import *
settings.useDepthPeeling = True
s = Sphere().alpha(0.6).lw(0.1)
sc = s.points()
pts1 = Points([sc[10], sc[15], sc[129], sc[165], sc[10]], r=12).scale(0.8)
pts2 = Points([sc[10], sc[15], sc[129], sc[165], sc[10]], r=12).scale(1.4)
rib = Ribbon(pts1, pts2).clean().cap().computeNormals()
scut = s.clone().cutWithMesh(rib)
ids = rib.insidePoints(s, returnIds=True)
scut2 = s.clone().deleteCellsByPointIndex(ids)
show([[s, pts1, rib], scut, scut2], N=3, axes=1) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
p-j-smith
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uhm the two modes work in very different ways.. so it's not obvious..
What you can do is to create manually a box which defines a region that you want to cut and the use
.cutWithMesh()
:I'll think if I find a bet…