added knife/loop cut idea?

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

added knife/loop cut idea?

Post by macouno » Sat Jul 31, 2004 3:17 pm

I love the knife and loop cut functions but I think we're missing one.

What I'd love to be able to do is.

Select 2 overlaying edges in a view... then have them subdivided at extactly the point where they intersect according to my view.

like in these
Image

So basicly in this model it would create 2 new verticles (one for each square) exactly on the spot where the 2 selected edges now cross.

Seems simple enough... actually I wonder if it's not possible already???

Recently I apparently need this function all the time. It's easy enough to do by hand if your edges are exactly vertical or horizontal already but at an angle it's nearly undoable.

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Sat Jul 31, 2004 3:25 pm

That should be fairly easy to code in, but how would you handle the subdivision of the faces? Creating triangles?

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno » Sat Jul 31, 2004 3:38 pm

Probably yes. Not the neatest approach but in this particular case that would be the way to go. Especially because you don't want verticles created in spots where you don't want them.

But then what if you were to select multiple overlaying edges.

Say you'd select all verts in the example above... then you'd need 4 verts added and well.. it would be rather tricky to make it all work face wise.

I don't have the solution for that... I think a coder would need to think about it because I don't know what actually happens "math/code wise" in the existing cut functions.

Perhaps the entire thing could be like the knife cut function but it would act as if a line were drawn exactly across those intersection points (and ignoring all the edges the line would cross but aren't selected)???? Wouldn't that work???


[edit] actually isn't the way that subdivisions of the faces are handled in the knife cut tool a function that you could simply "call on" in this cut functionality? I don't think new code would be needed for that at all??? [/edit]

FourMadMen
Posts: 0
Joined: Tue Jul 13, 2004 5:13 am

Post by FourMadMen » Sat Jul 31, 2004 8:07 pm

Why not just allow a set of verts (from a line or circle or plane or other set of contiguous verts) to populate the CutCurve structure used by the knife tool? You'd have to translate the x,y,z of the "template" object to x,y (screen co-ords?) for use by the CutCurve structure.

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno » Mon Aug 02, 2004 3:28 pm

See that's why coders should have a think cause you lost me there completely ;)

FourMadMen
Posts: 0
Joined: Tue Jul 13, 2004 5:13 am

Post by FourMadMen » Tue Aug 03, 2004 4:46 am

Sorry if I was unclear. How about some pictures?

First I'll try to say a few things about the knife tool in what is hopefully a clearer way. I'm you know most of this so I apologize if this seems obvious. The knife tool gets it's input from mouse clicks. For each mouse click the x and y position of the cursor is recorded. All of the mouse clicks (and the implied edges between them) are used to calculate intersections with the mesh edges. From these intersections new verts are created. I will use the bold tag for the non technical stuff, so...

Starting with our mesh (which in reality would be more complex).
Image

Next we select the knife tool (exact line mode) and start clicking out the shape. Hit enter and the intersections are computed.
Image

But what if we need a greater degree of precision with defining the cut points? Perhaps we can use a second set of verts do define the "mouse clicks"? Now each vertex in a mesh has three coordinates (u, v, and w) and the cutpoints only (u and v) so the 3-value vertex co-ord will need to be translated into just (u and v). This would be similar to the calculation already taking place for drawing any 3D vertex onto the 2D screen. (please also note the I use "U", "V", and "W" as the generic labels as "X", "Y", and "Z" are view specific)

Image

Now what we end up with is precise placement of the cut points in the mesh we needed to operate on. Because they came from a secondary set of verts and not the mouse.
Image

Hopefully this is now more clear. Now whether or not the set of cut-point verts are part of the object to be cut or a seperate object (I would think they should be a seperate object) is a matter for discussion but the desire is to have a means to define the series of cut-point with an absolute degree of precision that is not currently available. I envision the "cut-point mesh" to be defined by a plane, curve, circle (basically any set of verts that come in series). Now please remember this is not a boolean kind of thing it's just a way to specify the cutpoints of the cut line (the distance component of the "cut-point mesh" is taken out of consideration).

Clear as mud?

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno » Tue Aug 03, 2004 4:46 pm

I think what you mean is exactly like a boolean operation actually. As soon as it's a second object it certainly is. (just a new variant that doesn't create a sepparate mesh but only subdivides things)

And yes it's also a lot like what I meant, but not exactly ;)

I think the value of my original thought is in it's simplicity. Simply subdivide all selected crossing edges (according to view) exactly at the cross point. that's all... because it's so simple it's also very variable.

You could use this to do what you want, but also a lot of other things.

But then as teeth mentioned: it should be easy to code... which is nice, but that doesn't mean that anyone is actually going to... I wonder... any coders have a minute? hehe ;) It would be appreciated. I'd make it a "money for a feature" but I'm broke as always.

tuinbels
Posts: 17
Joined: Mon Nov 18, 2002 4:19 pm

Post by tuinbels » Tue Aug 03, 2004 9:06 pm

Would a python scriptbe good enough until someone hardcodes it in the sources?

It projects a closed mesh edgeloop onto a mesh in the global X, Y or Z direction.
It does not take into account the verts of the edgeloop.

Warning: it is not finished and it has some bugs, so use it at your own risk.

before:
Image

After using the 3 mesh edgeloops:
Image

and after removing the inner verts: :D
Image

I hope it is useful,

Wim

Goofster
Posts: 108
Joined: Mon Oct 14, 2002 12:26 pm

Post by Goofster » Wed Aug 04, 2004 12:05 am

Wow, very inventive!

Now learn some C :D

Roel

mr_rob
Posts: 0
Joined: Fri Jul 04, 2003 5:11 pm
Location: US of A
Contact:

Post by mr_rob » Wed Aug 04, 2004 12:44 am

Holy crap that is great! I can see half a million uses for it already!
Later,
Josh
:twisted: :twisted:

FourMadMen
Posts: 0
Joined: Tue Jul 13, 2004 5:13 am

Post by FourMadMen » Wed Aug 04, 2004 2:58 am

macouno wrote:I think what you mean is exactly like a boolean operation actually. As soon as it's a second object it certainly is. (just a new variant that doesn't create a sepparate mesh but only subdivides things)
Actually it's not a boolean operation at all. In fact it would use the existing knife tool code completely with the only exception being that the CutCurve object that is created from using the mouse would be populate using the viewplane location of the verts (x and y) from the second object.

FourMadMen
Posts: 0
Joined: Tue Jul 13, 2004 5:13 am

Post by FourMadMen » Wed Aug 04, 2004 3:00 am

tuinbels wrote:Would a python scriptbe good enough until someone hardcodes it in the sources?
This is exactly what I was talking about. Not a boolean op but simply a different way (a precise one) of gathering the edges used in calculating the intersections.

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno » Wed Aug 04, 2004 3:13 pm

Wow tuinbels that's great and very usefull indeed.

Though it requires sepparate meshes and doesn't work per edge in edit mode like I mentioned... still lovely ;)

madmen I understand what you meant now ;) you're right.

But then... since this would work nicely... how about populating it with selected edges in the mesh in edit mode...

I think this has lots of potential...

Perhaps whilst in edit mode it could use selected verts and out of edit mode it could use sepparated meshes??? or is that too confusing?

FourMadMen
Posts: 0
Joined: Tue Jul 13, 2004 5:13 am

Post by FourMadMen » Wed Aug 04, 2004 4:23 pm

macouno wrote: madmen I understand what you meant now ;) you're right.

But then... since this would work nicely... how about populating it with selected edges in the mesh in edit mode...
I'm indifferent as to whether or not it's a seperate object or select edge in edit mode although I think it might be harder to integrate into the knife tool if it used edges from within the mesh itself. This due to the fact that the kinife tool operates not on the whole mesh but on selected edges (i.e. how would it tell the difference between what is to be cut and what is doing the cutting).

Now perhaps you can help me put it into words because I've had a devil of a time trying to explaing this here (and elsewhere)?

theeth
Posts: 500
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Post by theeth » Wed Aug 04, 2004 4:40 pm

On a funny note, the example tuinbels posted made me think of a cookie cutter (or however those are called, the metal shapes used to cut cookies in all kinds of wild shapes).

Cookie Cutter, that's a really marketable name for a feature I think and it fits in the mumbo jumbo other 3D graphics companies uses when creating new functions. ;)

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

Post Reply