Blender Git Commit Log

Git Commits -> Revision de64d21

Revision de64d21 by Robert Wenzlaff (master)
October 19, 2003, 19:50 (GMT)
Adding Knife tool as to be released in 2.3

User Info:
To use this tool, select a group of verts, it can be larger than the
desired cut as explained below. Then hit Shift-K.
The tool will prompt for cut type (Exact line or Edge centers),
Select, then use LMB to draw a "cut-line". Holding down LMB causes
a freehand draw, clicking LMB causes a polyline draw. MMB locks the axis.
When done press enter to divide mesh on cut line. Subdivide routines have
been modified to produce fewer triangles as part of this tool.
Edge Centers preserves UV info, Exact Line does not (it will be there, just
slightly distorted).

Since the cut line exists in 2D space, and does not make a persistant
selection that can be modified in another 3D view, the knife selection
is the AND of the vertex selection and the knife line, ie; the edge will
be subdivided only if both verts are selected, and the knife line crosses
the edge. Select your verts first, but you don't have to be overly
precise. If you want to cut a few faces on the front of a sphere, you
can select the whole front of the sphere, then knife the faces you want.

Coder Info:
KnifeSubdivide is called with 1 of 3 modes. KNIFE_PROMPT, KNIFE_EXACT,
KNIFE_MIDPOINTS. The hotkey calls KNIFE_PROMPT. When adding to a menu
or button, explicitly call out the mode.

Part of the tool provides get_mouse_trail() that returns a CutCurve struct
that defines a knife line. There are modes defined, but currently they are not
implimented.

Another part of this tool defines new behaviour for subdivideflag().
Setting beauty param to B_KNIFE tells subdivideflag() that the edges
are preselected ans to skip the vert check. Also setting B_PERCENTSUB tells
subdivideflag() to divide the edge at a percentage of the distance from
eed->v1 to eed->v2. This percentage is passed in the eed->f1 flag as a
short (ie, setting eed->f1 to 16384 cuts the edge half-way).

Commit Details:

Full Hash: de64d218a08548d5b33f412374f360585356a41c
SVN Revision: 1355
Parent Commit: a56d3d1
Lines Changed: +21, -10

3 Modified Paths:

/source/blender/include/BIF_editmesh.h (+11, -2) (Diff)
/source/blender/src/editmesh.c (+9, -7) (Diff)
/source/blender/src/space.c (+1, -1) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021