diff options
author | Robert Wenzlaff <rwenzlaff@soylent-green.com> | 2003-10-19 23:50:17 +0400 |
---|---|---|
committer | Robert Wenzlaff <rwenzlaff@soylent-green.com> | 2003-10-19 23:50:17 +0400 |
commit | de64d218a08548d5b33f412374f360585356a41c (patch) | |
tree | 4066459135cd1ef6b7d681a52a793a37f3caa289 /source/blender/include | |
parent | a56d3d189a7c57d10398174d1cf5b08194daa2f3 (diff) |
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).
Diffstat (limited to 'source/blender/include')
-rw-r--r-- | source/blender/include/BIF_editmesh.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/include/BIF_editmesh.h b/source/blender/include/BIF_editmesh.h index 1a91d31750e..6cff0bdb692 100644 --- a/source/blender/include/BIF_editmesh.h +++ b/source/blender/include/BIF_editmesh.h @@ -54,8 +54,17 @@ typedef struct CutCurve { short y; } CutCurve; -void KnifeSubdivide(void); -CutCurve *get_mouse_trail(int * length); +void KnifeSubdivide(char mode); +#define KNIFE_PROMPT 0 +#define KNIFE_EXACT 1 +#define KNIFE_MIDPOINT 2 + +CutCurve *get_mouse_trail(int * length, char mode); +#define TRAIL_POLYLINE 1 /* For future use, They don't do anything yet */ +#define TRAIL_FREEHAND 2 +#define TRAIL_MIXED 3 +#define TRAIL_AUTO 4 + short seg_intersect(struct EditEdge * e, CutCurve *c, int len); /* End Knife Subdiv */ |