Notifications
Clear all

[Closed] I can't figure out how to use the "Cut" tool by script

Hi,

I am working on a little project which involves cutting an editable poly object from one point3 coordinate on the surface to the next one and so on.

So I got 1 variable holding the geometry and one variable holding an array of point3 coordinates which serve as the cutting points (new vertices if you will), all in order and on the surface of the geometry.

Now I can’t figure out how to use the polyOp.cutVert/cutFace/cutEdge tool, can anyone give me an example of how to achieve cutting from one point3 to another point3 on the surface?

25 Replies
delete objects
p = plane()
converttoPoly p
p.cutfaces 1 [-8.2,-10.5,0.0] [8.25,2.2,0] [0,0,1];

Thank you, but that solution only works when cutting ONE face, not across multiple faces afaik. I need to cut across multiple faces, like the cut tool works when using it via the GUI

Thank you, but that solution only works when cutting ONE face, not across multiple faces afaik.

try running the script

Hi,

Thank you, it works oO. interesting, the documentation says it doesn’t.

Anyways – I have to cut on a sphere and what I don’t get is the last part “[0,0,1]”. what exactly does that do and how would it look when I dont have a plane but a sphere to cut on. does that have to be the surface normal at the end cut point?

Edit: I see, it’s another method you are using. Also I will need to delete one half of the mesh after cutting but I got no idea on how to apprach that

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0
delete objects
s = sphere radius:20
m = SliceModifier Faces___Polygons_Toggle:1 slice_type:3
m.slice_plane.pos = [0,0,10]
addmodifier s m
converttopoly s

it’s the projection/view direction for the specified positions onto the surface. As the code is expecting a world position from a mouse click to then be projected onto the surface by the current viewport view direction as the user sees it.

if you are cutting through the whole model wouldn’t slice plane be better ? and then you can test the faces against the plane to see if they are above or below and delete accordingly.

Thank you for the infos.

Imagine my sphere is a pumkin and I need to carve a face into it.
Not exactly like that…hard to describe. Imagine instead of a face I want to cut off the lower half of the pumpkin, but not just in a sliced plane style but rather a complex form, like the folds of a skirt. But not randomly, I have defined the exact form of how the skirt should look like in the end by a dotted line (array of point3 coords along the surface of the pumpkin)

So basically from this dotted line I need to cut the mesh in half and later delete the bottom half of it.

I’ve attached an incredible paint artwork to illustrate the issue. circle = sphere, dotted line = array of point coords, red area = later to be deleted part of the mesh of the sphere

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

ok… i’ve missed this post… now i understand what you want.
it needs a different than we showed technique. the best result you can get if:

using your array of points create shapes

extrude shapes in the right direction to get mesh(es) to intersect with your cutting mesh

using BoolObj(ProBoolean, ProCutter) cut the mesh

find (somehow) and delete all is not wanted

I still don’t get my head around the first parameter (1 in your example). Do I have to find the nearest face of my point first, then fill in this point and the one I am cutting to and in the end find out the surface normal at the end point?

like this?

p.cutfaces ClosestFaceToP1 P1 P2 SurfaceNormalAtP2;

?

you can do it that way, but it will project p1 into the face specified using the “normal” direction if it’s not in the face it will interpolate a position on one of the edges of the face as the start of the cut.

Cant I just leave out the face somehow and always take the nearest one?..

Page 1 / 3