how can i draw a an extruded circle from vertex a ( x1, y1, z1 ) to vertex b ( x2, y2 , z2 ) ?
so i draw the circle at vertex a:
bpy.ops.mesh.primitive_circle_add(vertices=16, radius=0.02, fill=True, view_align=False, enter_editmode=False, location=( x1, y1, z1 ), rotation=(0.0, 0.0, 0.0))
I think you need a vector from the edge to make your extrusion… and also rotate the circle before doing that… Try this change to your code, it even worked on a monkey -there may be better ways I completly ignore, it would be nice to know some math- edit: it should work now
import bpy, mathutils
ob = bpy.context.object
me = ob.data
verts = me.vertices
for e in me.edges:
vs = e.vertices
start = vs[0]
end = vs[1]
meshVertexStart = verts[start]
meshVertexEnd = verts[end]
startco = meshVertexStart.co
endco = meshVertexEnd.co
victor = endco - startco
r = victor.angle((0,0,1))
a = victor.cross((0,0,1))
bpy.ops.mesh.primitive_circle_add(vertices=8, radius=0.03, fill=True, view_align=False, enter_editmode=False, location=startco)
bpy.ops.object.editmode_toggle()
bpy.ops.transform.rotate(value=[r], axis=a)
bpy.ops.mesh.extrude_region_move(MESH_OT_extrude={"type":'REGION'}, TRANSFORM_OT_translate={"value":victor})
bpy.ops.object.editmode_toggle()
look like solidify edges
but it does only the top and bottom part not the edges on the sides!
and new top and bottom is disconnected !
so need to remove doulbe also i think!
ok
that’s because of the angle of the circle where the extrusion starts
the angle between the direction of the extrusion and the surface of that circle is not 90 °
probably not that very hard to fix
but i don’t know how to do that right now
Hi, I updated the code above so that it really rotates the circle before extruding… a simple way of geting similar results would be deleting faces and converting edges to curve, then adding bevel. But again, it is good to learn something new.