[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39086] branches/soc-2011-avocado/blender/ source/blender/bmesh/operators/primitiveops.c: incremental commit to slines to bmesh tool.
Dan Walters
dan683 at gmail.com
Sat Aug 6 00:10:46 CEST 2011
Revision: 39086
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39086
Author: dan_w
Date: 2011-08-05 22:10:45 +0000 (Fri, 05 Aug 2011)
Log Message:
-----------
incremental commit to slines to bmesh tool. Added vertex welding and began unwanted vertex and edge removal
Modified Paths:
--------------
branches/soc-2011-avocado/blender/source/blender/bmesh/operators/primitiveops.c
Modified: branches/soc-2011-avocado/blender/source/blender/bmesh/operators/primitiveops.c
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/bmesh/operators/primitiveops.c 2011-08-05 21:25:17 UTC (rev 39085)
+++ branches/soc-2011-avocado/blender/source/blender/bmesh/operators/primitiveops.c 2011-08-05 22:10:45 UTC (rev 39086)
@@ -686,6 +686,8 @@
BMO_Flag_To_Slot(bm, op, "vertout", VERT_MARK, BM_VERT);
}
+#define ELE_DEL 3
+
void bmesh_create_mesh_from_splines(BMesh *bm, BMOperator *op)
{
bGPDstroke *gps, *gpsn;
@@ -696,6 +698,9 @@
BMVert *bm_vertex;
BMVert *bm_previous;
BMVert *bm_intersect;
+ BMVert *v;
+ BMEdge *e;
+ BMIter iter;
int i, j;
@@ -757,6 +762,7 @@
{
// there is an intersection hence we must add an extra vertex and 2 edges rather than just one edge
bm_intersect = BM_Make_Vert(bm, i_vec_intersect, NULL);
+ BMO_SetFlag(bm, bm_intersect, VERT_MARK);
// create edge
BM_Make_Edge(bm, bm_intersect, bm_previous, NULL, 0);
@@ -777,9 +783,20 @@
}
// perform weld on vertices that do not share an edge
+ BMO_CallOpf(bm, "removedoubles verts=%fv dist=%f", VERT_MARK, 0.001f);
+ // remove vertices that have 2 or less edges
- // intersect each spline segment with each other spline segment
+ BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
+ //v->
+ }
+
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ if (BMO_TestFlag(bm, e->v1, ELE_DEL) || BMO_TestFlag(bm, e->v2, ELE_DEL)) {
+ BMO_SetFlag(bm, e, ELE_DEL);
+ }
+ }
+
// generate bmesh edge list, using start of spline, end of spline, intersections as vertices
// weld / merge vertices
// fill in faces
More information about the Bf-blender-cvs
mailing list