[Closed] 3dscanner
hi, we have a project, its a arm/3dscanner. we can create all the electronics and phisical components but we need someone who help us with the software. You probably know the tipology brush of Silo or the polyboost’s polydraw… well if not they work by creating lines over an existing object, when the lines intersect 4 times like # [size=2]it creates a polygon. something like that. so, we need a script that takes out the data off the arm ( X Y Z coordenades) and create lines. then create the polygons into 3dsmax. i hope you can help us …\
tx in advance
[/size]
how would the script read the arm data ? if its output was a text file it would be easy to make a script to read that file and make a mesh out of it .I have done this a few times . if it has to read data from a com or usb port then Im lost.
i can create a text file. would 3dsmax take the data from there in real time?
no but why would it need to be real time ? make the arm scan in the object then output it to a text file then max reads the file and make the object in 3d from that file .
well, you can see what we whant here. http://www.nevercenter.com/videos/index.php?vidclip=topology_and_snapping.mov&artist=Walter%20Behrnes
its important to see what you are modeling because if you are working with complex models its easy to see what you alredy have done, as well if something isnt good. thats what i tought so far, maybe you have a better idea, zeta150″hotmail.com
well for real time as Im sure you know the arm would need would need to talk to max so you would need a way of max talking to one of the com or usb ports, I dont think you can do this in max script I think you would need to write a plugin using C or C++ ,and thats over my head .anyway maybe some else can think of something better, still do let me know how you get on and do you have any pictures of your scanner ? I lwould love to see it .
well, supose ii create a text file. how would 3dsmax create the polys? i need quads. in what kind of orther ? it would be a mess to memorize the alredy used points and to imput them in a specific sequence so it dont flip faces or create triangles.
If you read up on the online help thats comes with max you will see its not that hard to make an object using data from a text file , if you look at my midi script you will see I have done just that in the keyboard maker part of the script. Ive not got max here at work but just off the to of my head I would say soemthing like this should work.
data list form arm should be something like this ;
x=64 y=34 z=124
x=67 y=32 z=166
x=52 y=33 z=186
x=69 y=35 z=183
x=61 y=34 z=167
these are the vertex points from here you get max to read this data in and make your object.
if you get the arm working and outputing the vertext list I will help you with the max side of things that being reading of the file and making the object from the data .
cool! ok , so what kind of object will i get if i give you this data. and what tipe of polygons.
X Y Z
30.0 -25.0 0.0
30.0 25.0 70.0
30.0 25.0 0.0
-50.0 -25.0 70.0
-50.0 -25.0 0.0
30.0 -25.0 70.0
-50.0 25.0 0.0
-50.0 25.0 70.0
My advice is :
Store intersect 3Dpoints betwen lines in an array.
like this #([0,-10,0],[10,0,0],[0,10,0],[-10,0,0]…)
dont forget store data in ccw! (prevent flipping)
or
make a function to check normal after polygon is created. Example:
fn isFliped obj ActivePolygon =
(
local dir1 = mapScreenToWorldRay mouse.pos
local dir2 = (normalize (polyOp.getFaceNormal obj ActivePolygon))
--format "dir1:% dir2:%
" dir1 dir2
local identical = 0
for i=1 to 3 do
(
if (dir1[i] > 0 and dir2[i] > 0) or (dir1[i] < 0 and dir2[i] < 0) then identical += 1
)
if identical > 1 then return true else return false
)
Now I making a new function for this propose (more accurated)