Skip to content

cutPointsWithLoop cuts two loops when 'on' is set to 'cells' #633

Answered by marcomusy
p-j-smith asked this question in Q&A
Discussion options

You must be logged in to vote

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():

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)


I'll think if I find a bet…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@p-j-smith
Comment options

Answer selected by p-j-smith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants