Edge length in bf-blender

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

Moderators: jesterKing, stiv

GreyBeard
Posts: 0
Joined: Sun Jul 18, 2004 5:49 am

Edge length in bf-blender

Post by GreyBeard » Wed Apr 06, 2005 1:51 am

The new edge length display requires the verts at both ends of the edge to be selected in order for the distance to be displayed. I would find it more useful that if by selecting a vert all edges entering that vert had their lengths displayed. This way you could move a vertex and see the new lengths of the edges change dynamically. Very useful for architectural drawings and other similar "to scale" work. What do you think??
The same could be said for the angle and area display.

GreyBeard

z3r0_d
Posts: 289
Joined: Wed Oct 16, 2002 2:38 am
Contact:

Post by z3r0_d » Wed Apr 06, 2005 6:51 am

you could just hit control+padPlus

I think the current behavior is more like blender's behavior, selecting one vert and subdividing doesn't subdivide all connected edges. Does this mean a lot? ... I don't know, I guess it is up to some ultimate designer of blender's ui and stuff [ton?]

GreyBeard
Posts: 0
Joined: Sun Jul 18, 2004 5:49 am

Post by GreyBeard » Wed Apr 06, 2005 8:41 am

you could just hit control+padPlus
No this wouldn't give me the functionality I'm looking for. The way it is now if I "display lengths" and select an edge I can see the edge length change dynamically as I scale. If I move one end of the edge I can't see the length change because I only have one vert selected. What I am looking for is an easy way to set an edge to a precise length. There is still no convenient method to do this in blender and the edge length display would afford us the opportunity to do this rather easily.
I think the current behavior is more like blender's behavior, selecting one vert and subdividing doesn't subdivide all connected edges.
You are comparing an editing command to a display command. The other display commands remain visible if the faces, verts, objects etc. are selected or not, for example normals, faces, name, axis etc.

I just though displaying all lengths would be too cluttered and computation intensive -- hence my suggestion that just the edges connected to selected verts be displayed.

GreyBeard

ideasman
Posts: 0
Joined: Tue Feb 25, 2003 2:37 pm

Post by ideasman » Wed Apr 06, 2005 1:43 pm

Hi,teach draw mode was my early work- I originally coded it so only 1 vert needed to be selected for the length to de drawn but It was decieded against by people with CVS accsess :)

There has been about 3 posts asking for this...
since it only requires chenging a few && ..to ||'s I think sombody should go ahead and do it.

A simple example of how usefull it is - when your extruding a vert, you cant see the length of the new edge behind the selected vert. It would be nice to be able to.
--

joeri
Posts: 96
Joined: Fri Jan 10, 2003 6:41 pm
Contact:

Post by joeri » Wed Apr 06, 2005 3:19 pm

How would I know wich of the 3 edges is wich of the 3 displayed numbers?
And why stop at the connected edges? why not also face area size, cube content size?
Only edge length? And what if the vertex is not on an ax? Also the length along x,y,z axis?

Looks to me that this request is a big pitfall for new feature tweeks; there is never enough information for everybody.

GreyBeard
Posts: 0
Joined: Sun Jul 18, 2004 5:49 am

Post by GreyBeard » Wed Apr 06, 2005 6:04 pm

joeri wrote:
How would I know wich of the 3 edges is wich of the 3 displayed numbers?
By asking this question you obviously haven't even tried the command and noted how it presently works. The lengths are drawn in the 3d view beside the edge it describes.
Only edge length?
If you read my original post I said the same argument could be used for angles and areas.
And what if the vertex is not on an ax?
This comment makes no sense at all -- why would the vertex have to be on an axis?
Also the length along x,y,z axis?
That is not one of the current options - I'm not asking for something new I just want the stuff currently being added to be more useful.
Looks to me that this request is a big pitfall for new feature tweeks
Why would it be a pitfall for future feature tweaks? Nothing in your post leads to this conclusion.

ideasman wrote:
A simple example of how usefull it is - when your extruding a vert, you cant see the length of the new edge behind the selected vert. It would be nice to be able to.
This is precisely what I would like it to work like. I would even settle for a persistant display (select some edges and press "display length", these lengths are persistently shown until a new group or null group of edges are assigned with the "display length" button.

GreyBeard

pinhead_66
Posts: 17
Joined: Wed Oct 16, 2002 10:09 am
Location: Belgium

Post by pinhead_66 » Wed Apr 06, 2005 11:06 pm

I'm with you on this one GreyBeard.

I tend to use the view edge length quite often, but is is anoying in a way that you have to scale two vertices to optain a certain distance. It would be much easier and preciser if you could take one vertex, view all the edge lenghts to its connected vertices and see the distance change when you move it

For moving several vertices this would sure come at handy too.

This in combination with the current cvs build in which you can snap to the visible grid (no more adjusting the grid spacing) would make modelling to scale and size much easier and more precise.

Also, right now if you use show edge length and widgets (in cvs build), the center of the widget gets drawn over the length, making it hard to see

greets

joeri
Posts: 96
Joined: Fri Jan 10, 2003 6:41 pm
Contact:

Post by joeri » Thu Apr 07, 2005 10:15 am

Image

Your request and how it can evelange into a datasheet. (only distance shown)

btw.
..Nothing in your post leads to this conclusion..
is the worst defense I ever heard. I didn't have a conclusion.

But I'm sorry that I was not clear, I hope the image is more clear.
I'm not against your proposal, I want to make clear that it might be better to think about a messure tool or something then asking for 1 distance more then blender can do at the moment.
Now it's this edge you want to know about, but once implemented you'll find out you might also want to know about the ... (aha and there is the pitfall, you've got your reqeust only to find out you now have another one).

Think tools, not features!

GreyBeard
Posts: 0
Joined: Sun Jul 18, 2004 5:49 am

Post by GreyBeard » Thu Apr 07, 2005 12:02 pm

Joeri,

I think your english is what's confusing the matter. I want it to behave exactly as in your picture on the left. I'm not asking for the picture on the right. Currently in bf-blender you have to have both ends of the edge selected or you can't see the distance. I don't want any additional information displayed -- only WHEN it is displayed.

picture 1. Draw lengths pressed (note the verts selected)
(current bf-blender behavior)
Image

picture 2. Draw lengths pressed, only one vert selected -- I can't see distances anymore
(current bf-blender behavior)
Image

picture 3. What I would like -- I can see the lengths of edges connected to the selected vert. I want to see the values change as I move the vertex.
(same as your left hand picture)
Image

I have never requested what is shown in your right hand picture in my posts.

GreyBeard

DYeater
Posts: 0
Joined: Fri Sep 24, 2004 9:25 pm
Location: Enon, Ohio USA

Post by DYeater » Thu Apr 07, 2005 6:25 pm

I think GreyBeard's proposal makes perfect sense. If only 1 vert is selected, show the dimensions of each edge that has that vert in common. Simple ... from a user's standpoint. 8)

joeri
Posts: 96
Joined: Fri Jan 10, 2003 6:41 pm
Contact:

Post by joeri » Thu Apr 07, 2005 7:35 pm

GreyBeard wrote:I have never requested what is shown in your right hand picture in my posts.
I don't think that's what I'm saying.
What I'm trying to say is that your request will lead to more requests of the same order. And instead of asking them one by one it's better to come with a general solution. At least 'better' in my point of view.

lguillaume
Posts: 0
Joined: Tue Jan 04, 2005 10:25 pm

Post by lguillaume » Thu Apr 07, 2005 7:44 pm

GreyBeard wrote: picture 3. What I would like -- I can see the lengths of edges connected to the selected vert. I want to see the values change as I move the vertex.
(same as your left hand picture)
Image
GreyBeard
Hello, there is a patch which make this a long time ago, I don't remember who made this but I have the file on my computer (I don't tested with the current CVS) :

Code: Select all

? source/blender/makesdna/intern/dna.c
Index: source/blender/blenkernel/BKE_global.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/BKE_global.h,v
retrieving revision 1.18
diff -u -r1.18 BKE_global.h
--- source/blender/blenkernel/BKE_global.h	8 Jan 2005 21:16:24 -0000	1.18
+++ source/blender/blenkernel/BKE_global.h	17 Jan 2005 20:48:56 -0000
@@ -178,6 +178,8 @@
 #define G_DRAW_EDGELEN   (1 << 22) 
 #define G_DRAW_FACEAREA (1 << 23)
 #define G_DRAW_EDGEANG  (1 << 24)
+#define G_DRAW_ALLEDGE	(1 << 25)
+#define G_DRAW_MODEDGE	(1 << 26)
 
 /* G.fileflags */
 
Index: source/blender/include/BIF_editmesh.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/include/BIF_editmesh.h,v
retrieving revision 1.36
diff -u -r1.36 BIF_editmesh.h
--- source/blender/include/BIF_editmesh.h	24 Nov 2004 16:29:10 -0000	1.36
+++ source/blender/include/BIF_editmesh.h	16 Jan 2005 00:00:46 -0000
@@ -168,6 +168,7 @@
 extern void fill_mesh(void);
 extern void bevel_menu();
 void edge_rotate_selected(void);
+extern float get_meas_scale(void);
  
 #endif
 
Index: source/blender/src/buttons_editing.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_editing.c,v
retrieving revision 1.90
diff -u -r1.90 buttons_editing.c
--- source/blender/src/buttons_editing.c	12 Jan 2005 22:28:12 -0000	1.90
+++ source/blender/src/buttons_editing.c	17 Jan 2005 21:35:33 -0000
@@ -159,7 +159,7 @@
 static float extr_offs= 1.0;
 static float editbutweight=1.0;
 short editbutflag= 1;
-float doublimit= 0.001, editbutvweight=1, editbutsize=0.1;
+float doublimit= 0.001, editbutvweight=1, editbutsize=0.1, meas_scale = 1.0; 
 float uv_calc_radius= 1.0, uv_calc_cubesize= 1.0;
 short uv_calc_mapdir= 1, uv_calc_mapalign= 1, facesel_draw_edges= 0;
 
@@ -384,6 +384,10 @@
 	}
 }
 
+float get_meas_scale(void) {
+	return meas_scale;
+}
+
 /* *************** */
 
 void do_common_editbuts(unsigned short event) // old name, is a mix of object and editing events.... 
@@ -2133,8 +2137,11 @@
 	/* Measurement drawing options */
 	uiBlockBeginAlign(block);
 	uiDefButI(block, TOG|BIT|22, REDRAWVIEW3D, "Edge Length",	1125,131,150,19, &G.f, 0, 0, 0, 0, "Displays selected edge lengths");
-	uiDefButI(block, TOG|BIT|24, REDRAWVIEW3D, "Edge Angles",	1125,110,150,19,  &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees");
-	uiDefButI(block, TOG|BIT|23, REDRAWVIEW3D, "Face Area",		1125,88,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces");
+	uiDefButI(block, TOG|BIT|25, REDRAWVIEW3D, "All",           1125,110,75,19, &G.f, 0, 0, 0, 0, "Displays lengths for all edges");
+	uiDefButI(block, TOG|BIT|26, REDRAWVIEW3D, "Modified",      1200,110,75,19, &G.f, 0, 0, 0, 0, "Displays lengths for moving edges");
+	uiDefButI(block, TOG|BIT|24, REDRAWVIEW3D, "Edge Angles",	1125,88,150,19,  &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees");
+	uiDefButI(block, TOG|BIT|23, REDRAWVIEW3D, "Face Area",		1125,66,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces");
+	uiDefButF(block, NUM,        REDRAWVIEW3D, "Scale:",		1125,44,150,19, &meas_scale, 0.001, 1000.0, 100, 0, "Sets the scale for displayed length and areas");
 	uiBlockEndAlign(block);
 
 }
Index: source/blender/src/drawobject.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/drawobject.c,v
retrieving revision 1.142
diff -u -r1.142 drawobject.c
--- source/blender/src/drawobject.c	12 Jan 2005 22:28:12 -0000	1.142
+++ source/blender/src/drawobject.c	17 Jan 2005 21:39:42 -0000
@@ -2729,7 +2729,7 @@
 	EditMesh *em = G.editMesh;
 	EditEdge *eed;
 	EditFace *efa;
-	float *v1, *v2, *v3, *v4, fvec[3];
+	float *v1, *v2, *v3, *v4, fvec[3], length = 0.0f;
 	char val[32]; /* Stores the measurement display text here */
 	float area, col[3]; /* area of the face,  colour of the text to draw */
 	
@@ -2748,12 +2748,29 @@
 		
 		/* Now Draw distance */      
 		for(eed= em->edges.first; eed; eed= eed->next) {
-			if(eed->f & SELECT) {
+			if(G.f & G_DRAW_ALLEDGE) { //check if Draw all edge lengths is selected
 				v1= eed->v1->co;
 				v2= eed->v2->co;
-				
 				glRasterPos3f( 0.5*(v1[0]+v2[0]),  0.5*(v1[1]+v2[1]),  0.5*(v1[2]+v2[2]));
-				sprintf(val,"%.3f", VecLenf(v1, v2));
+				length = VecLenf(v1, v2) * get_meas_scale();
+				sprintf(val,"%.3f", length);
+				BMF_DrawString( G.fonts, val);
+			} else if(G.f & G_DRAW_MODEDGE) { 
+				//try to find all edges that is selected!
+				if(eed->v1->f & SELECT || eed->v2->f & SELECT) {
+					v1= eed->v1->co;
+					v2= eed->v2->co;
+					glRasterPos3f( 0.5*(v1[0]+v2[0]),  0.5*(v1[1]+v2[1]),  0.5*(v1[2]+v2[2]));
+					length = VecLenf(v1, v2) * get_meas_scale();
+					sprintf(val,"%.3f", length);
+					BMF_DrawString( G.fonts, val);
+				}
+			} else if(eed->f & SELECT) { //check if edge is SELECTed{
+				v1= eed->v1->co;
+				v2= eed->v2->co;
+				glRasterPos3f( 0.5*(v1[0]+v2[0]),  0.5*(v1[1]+v2[1]),  0.5*(v1[2]+v2[2]));
+				length = VecLenf(v1, v2) * get_meas_scale();
+				sprintf(val,"%.3f", length);
 				BMF_DrawString( G.fonts, val);
 			}
 		}
@@ -2774,7 +2791,7 @@
 					area=  AreaQ3Dfl( efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co);
 				else
 					area = AreaT3Dfl( efa->v1->co, efa->v2->co, efa->v3->co);
-
+				area *= (get_meas_scale() * get_meas_scale());
 				sprintf(val,"%.3f", area);
 				glRasterPos3fv(efa->cent);
 				BMF_DrawString( G.fonts, val);

Zsolt
Posts: 4
Joined: Thu Oct 17, 2002 9:39 pm

Post by Zsolt » Sun Apr 10, 2005 10:28 am

Okay, I also agree with GreyBeard! When I do precise modelling, I also need to see the edges that I'm editing. Currently the workflow is: select end vertex, move it, select the other end, see the edge length, deselect the other end, move the first vertex again (5-6 steps). This would change to: select one vertex and move it (seeing the info all the time), ie: 2 steps!!

joeri: Saying that something won't be implemented, because then people would ask for other things makes no sense, actually, it defeats the whole purpose of having new features! Why add anything new, lets say softbodies, when sooner or later people will want other new stuff, like cloth simulation? This is how any software, esp. open sourse, evolves, no?
Especially since as I understand it it takes only a few minutes to change it. If I knew enough about coding and CVS compiling, I'd do it myself.
And btw: I wouldn't call this a new feature, but correcting an existing one, to actually make it useful. If anyone finds it too cluttered, turn it off! they probably don't want to see that info anyways...

_styken
Posts: 0
Joined: Sun Jul 13, 2003 10:32 pm
Location: Stockholm, Sweden

Post by _styken » Sun Apr 10, 2005 9:16 pm

Hello, there is a patch which make this a long time ago
Hmm, that looks like my code. I was drawing my new garage and needed that function. So its a quicky but it worked for my needs!

But I'm into joeri path that we should be looking over all aspects of this so we dont do it one at a time.


//styken

joeri
Posts: 96
Joined: Fri Jan 10, 2003 6:41 pm
Contact:

Post by joeri » Mon Apr 11, 2005 1:36 am

Zsolt wrote: joeri: Saying that something won't be implemented, because then people would ask for other things makes no sense, actually, it defeats the whole purpose of having new features!
Nope, you don't get my point.
Asking for features makes only sense if someone wants to implement them. If you are handing out tasks then most likely nobody is going to do it. Unless somebody did it already for himself and might want to share, that's a different case. That's my opinion, but it's based on 8 years following blender development.

Zsolt wrote:Why add anything new, lets say softbodies, when sooner or later people will want other new stuff, like cloth simulation? This is how any software, esp. open sourse, evolves, no?
No. If it does, it's bad practice. Hacking in small details without thinking about the big picture is going to break up the code. Just look how marvolus firefox is; pretty much build from ground up, not a basic thing with lots of added silly little requests.
Zsolt wrote:Especially since as I understand it it takes only a few minutes to change it.
If I knew enough about coding and CVS compiling, I'd do it myself.
Well you don't, so how can you argue on this topic anyway?
Why would I do it for you? Only to hear someone ask to get it out again or todo something else, in the meantime I have become your employee.
Zsolt wrote:And btw: I wouldn't call this a new feature, but correcting an existing one, to actually make it useful. If anyone finds it too cluttered, turn it off! they probably don't want to see that info anyways...
So how about a mesure tool?
You can select an object and/or edge and/or vertex and/or face and put it in 'draw value' mode. Select two objects and it will draw the distance between them, select an object and vertex and it will draw the distance in between them, select 3 verteces and it will draw the distance inbetween them.

See what I mean, I turned the little feature request into a tool, alot more people can use it, in alot more cases. But, probably with the same amount of work for the developer. Not only making it nicer to make, but a better tool to have.

Post Reply