Jump to content

CoolHardMaths

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by CoolHardMaths

  1. Alright, progress. I have programmed a dirty python class (in IDLE not blender) which takes a function with parameters z,x and returns y. It then adds each new vertex to a list. Currently its just a jumbled list of vertices in the order they where generated. The blender API looks simple enough so as soon as I find away to assign vertex tuples to faces I should have a working prototype. The function for generating vertices has to be hard coded unfortunately and I'm currently testing with a simple hemisphere. I'm also starting to think it might be much cleaner to generate meshes radially rather than up from a grid. Your thoughts would be appreciated. import math class f3dmesh: #class 3d mesh is an object which handles a mesh based on the output of a 3 var function vertices = [] edges = [] faces = [] def __init__(self): self.data = [] def make_vector(self,x,y,z): #return a list object in x,y,z format vec = (x,y,z) return vec def obj_func(self,x,z): #this function defines the geometric function of the vectors #will return string "none" if encountering a domain error try: #FUNCTION GOES HERE y = math.sqrt(pow(5, 2) - pow(x, 2) -pow(z, 2)) return y except: return "none" def build_mesh(self ,Xrange, Zrange): #scan through Z for each val X for indexX in Xrange: for indexZ in Zrange: #get val of Y from obj_func(x,z) Y = self.obj_func(indexX, indexZ) if Y != 'none': #add to vertices if Y is defined at x,z self.vertices.append(self.make_vector(indexX, Y,indexZ)) def get_verticies(): return vertices def get_edges(): return edges def get_faces(): return faces
  2. Don't be sorry for parade raining, That's why I added that Q&A at the end so people could let me know if I'm wasting time. That being said yes I am talking about generating the actual model.
  3. Hello, My name is Rick and I've beenplaying KSP for a while now. The game is so greatly improved with theuse of mods such as B9 that I felt the need to contribute. So I'madapting an idea I had (originally for designing ship hulls) to makea blender extension for designing KSP parts. The plugin will allowyou to auto generate a mesh from a 3 variable function and create acollision mesh. This is my plan for development. First release develop algorithm to generate simple mesh object add material to the mesh auto generate collision mesh create GUI Second release add peicewise functionality(use different functions for x > or < whatever) Third release improve vertex spacing to reduce polygon count to smallest possible number So before I start, while learning touse unity/blender, I have a few questions from the modding community. Any words of wisdom? Has anybody tried this? What features would you like to seefrom this? What else can be automated in blender? Would you make use of this plugin? Where can I find good python in blendertutorials? Has this given you any ideas? Pleaseshare below. Thank you.
×
×
  • Create New...