vertices on circle

i’m printing the vertices in a circle with z-0


mer2 = B.Mesh.Get( activeObject.data.name )
print " mesh name =",mer2.name
 
 
# get the vertices in mesh data
 
for v in mer2.verts:
qtyv+=1
print "v =",v 
 
print "Qty V =",qtyv
 

now then i print out and it gives me 2 set of coordinates per vertices
why 2 sets or 5 vertices coordinates ?
this is like if there was 64 vertices instead of 32 ?
Thanks

The following should work:


me = B.Mesh.Get(activeObject.data.name)
print "mesh name = ", me.name

qtyv = 0
for v in me.verts:
    qtyv += 1
    print "v=", v
    
print "Qty V = ", qtyv

A couple things you might try:

  1. Make sure that qtyv is 0 before the loop
  2. Make sure you don’t have double vertices

Some more tips:
-Its much easier if you want the length, to just say len(me.verts).
-To make your code tags work, put a / in front of the closing code tag like [ / code] (without the spaces)

i’m selecting a specific circle and there is no double

so i’m still wondering why there are 2 sets giving 64 vertices

and i put the code things in another file before copying it in here
but i guess this did not work as expected!

i wish i cold put the console text but don’t know how to copy it !
i can copy the whole little file if i have to - its vdery small
let me know

Thanks

For code tags look at this for a template: http://pasteall.org/1276

Yes, it would help if you could post the whole file either here or to pasteall or somewhere similar.

How many vertexes does the user interface say the object has?

ok in edit mode i get 32 vertices

so that seems ok

but on the console screen i see 2 sets per line!
i’ll put the blend file on FTP site so you can download it
be back with url

for the code i had the code thing before and after the code text
but i transfered it from another asciii file
so i guess it did not work!
next time i’ll do it direclty in the thread!
http://uploader.polorix.net//files/1502/circletosquare1.blend

Thanks

Ok, I see what you’re talking about now…

Mverts hold the coordinate as well as the normal of the vertex. One of the 3 Item lists you see are the coordinates and one is the normal for the vertex.

ok i tough that the normal was only for faces
but where does the normal of a vertex point to?
and is it possible to get only the location vertex or if i have to manually select the first set only

and if i change the location (first set ) will this automatically affect the value of the normal or if it has to be changed manually?

Thanks

Face normals, if I recall correctly are calculated from vertex normals. I believe they just point out of the mesh based off the angles edges move away from the current vertex.

If you have an MVert, say ‘v’, then to get the coordinate all you have to do is ‘v.co

I believe everything is update automatically, though you could set the normal if you wanted.

last week i was working and still is on a small script to do triangles
and with that i a created each vertex and them that into an object and then created the object datablock

but when i printed the vertices there was only one set of vertex
why with the blender primitive like circle do we handup with 2 sets?
have you seen any doc on how theses normal are calculated
would be interesting to see how because i want to modified the circle vertcies
hopefully in a logical way!

news: i found in F9 a button to draw the Vnormal and on the circle this follows the edges direction
so v normal must be calculated after the edges are done!
but on my script for triangle the Vnomral are normal to the face!

2 )
in for v in mer2.verts:
mer2.Verts is a list of all the vertices so how can i print the component of each vertex - The X Y Z value?

Salutations