Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Using MEL to create objects (https://simplymaya.com/forum/showthread.php?t=5593)

DukerX 03-05-2003 11:38 AM

Using MEL to create objects
 
Is it possible to make a MEL script that reads inputs from a file or the COM port and uses the data to create a CV-curve?

I´m making a little item to "3D scan" cars.
Uses a micro-controller chip wich I progrram myself.
I could either store coordinates locally on the EEPROM, and then read it out and put it into a file, wich then is imported into maya through a MEL script, or Icould integrate a UART interface in the microcontroller, and make it send a "live feed" to the computer COM port, and read it directly into maya using MEL.
The reason for doing this is that I want to get the car into 3D and then be able to apply and customise various styling gear and in turn export the models of the customised stylig gear to a 3D mill.

Any pointers to where I can find out more about that kind of MEL scripts? (The part that involves reading data fom my 3D scanner)

lalamax3d 03-05-2003 05:00 PM

very nice work..just wanna appriciate
 
well , too high level discussion for me @ least but

very first, very nice and impressive
i really wanna appriciate suce nice work

what i could say: if i will be the user never prefer for file storing and then loading data to maya for creation

there must be some middle ware thing that integrate run time to show real time creation of that data coming through port

sorry guy, i really can't help u out but

good luck and best wishes....

keep it up

haseeb

Alan 03-05-2003 05:37 PM

if you can make your 3d scanner dump put a text file of the data then you can easily read it into maya (this is exactly what I am doing in my current WIP, see the link in my sig)

It's farily easy to read thru a file and set keyframes etc and i'm sure that it's just as easy to set the points on a curve.

Post again with some more specfics and I'll point you in the right direction.

Alan

adldesigner 03-05-2003 05:42 PM

This surely sounds good.
I´ll be watching this thread´s development closely.

strarup 03-05-2003 06:25 PM

this sounds quite interesting... :)

for my final exam project I played a bit with drivers... mostly USB... but I also looked at some other drivers... to try to learn how it worked etc...

unfortunately I don't know much about MEL scripting yet... I'm mostly educated in Java... and have played a bit with VB and C++... but I would like to help if I can... :)

do you e.g. have some more info about your scanner?

regards

Strarup

Alan 03-05-2003 08:11 PM

Strarup: MEL is just C coding with a few syntacical differences. It's really quite simple to get to grips with (well sorta! ;))

DukerX 06-05-2003 05:10 PM

(Posted at Haakonsvern Naval Base)
 
So.. I could integrate an IO controller DLL declaration right into the mel script, and read the data from the parallel port right into the script?

I´ve been doing quite alot of various VB stuff, and have found some nice DLLs to use, but I think the INOUT.DLL could be called by any windows application regardless of development language.

For the 3D scanner... I´ve not actually built it yet, but I´ve been working on some ideas.

The core is an ATMEL AT8515S for those who know microcontrollers. It´s a 8 bit RISC processor, running at up to 8MHz.

The first thought was to build a rig that was driven by step-motors, scanning the entire surface of the car using a laser-beam, but I dropped the idea, cause there is a slight problem using light rays for distance measurements: For a accuracy of +/- 1meter the meaure circuit would have to run at 300MHz !!! and for 1 mm (millimeter)... You figure it out :P
So I kinda dropped that thought, and changed my mind. I think I´ll go for a simpler and more lightweight rig, that is manually operated. It´s a rig that can move over the car, much in the same way as the small fully automated car-washers you´ll find in almost all small gas stations in Norway, only it´s not powered by engines, and made from very lightweight components.

It has digital encoders on all axis, and a little button on a handle, and each time the button is pushed, it stores X,Y and Z coordinates, or send it straight to the computer (I haven´t desided wich metode i´ll use) With this aproach, I´ll have more control of what data I actually get. I could trace the outline of the bonnet, roof and windscreen, and use birail or birail+ to create the surfaces from the CV curves generated by the MEL-script.

It´s not as cool as the fully automated, but it´s easier to build and ALOT cheaper, alltho´I haven´t given up that idea either. There is just one problem: I´m in the army right now (all Norwegian men have to complete one year of military service. Undseth (did I spell it right?) could tell you more) and that reduces the time I get to spend on my computer and in the workshop, but I got alot more time to think about stuff , and come up with ideas.
Right now I´m drawing a fully automated system that uses one laser, wich moves across one plane of the car, and a ultra acurate detector wich locates the laser "dot" on the car surface, and from the angle of the laser and the detector, It should be possible to calculate the distance, but It´s gonna be slow, and the coding of the microchip wil be quite advanced.

A bit off-topic but If you have ideas on a different design, please post!

adldesigner 06-05-2003 05:26 PM

Gonna talk to some of the electronic engineering guys at the University to see how would they create such a device, if it´s under budget I´ll frigging build it. Nurbs patches are far easier to lay out over a live model.

Roland´s LPX-250 model is selling at about 9000$, and it´s one of the cheapest around. (non-contact model)
So I guess this could be a cheaper alternative, although time costly .. not to mention what it could do to your mental health. :)

adldesigner 06-05-2003 05:44 PM

Desktop though ...
.. yours looks like an industrial-sized 3d scanner.
This is one of the most interesting topics ever to grace this site.

DukerX 06-05-2003 06:06 PM

(Still at Haakonsvern Naval Base)
 
Hehe. I´m flattered...
I thought I´d mentione it for some people here at the base. I know a couple of guys who knows about this stuff too, but If you could get some input, it would be really cool.

I´ll be back with more info later on.

(This project have been on my mind since I started 3D modelling. I think if I can make it work, I´ll post info about how I did it, MEL script, Processor code and other scematix related (PCB-layouts and where to get the parts cheap. By the way... Outdated Xerox machines area great source for step-motors and power-electronics.)

adldesigner 06-05-2003 06:25 PM

Re: (Still at Haakonsvern Naval Base)
 
Quote:

Originally posted by DukerX
I´ll post info about how I did it, MEL script, Processor code and other scematix related (PCB-layouts and where to get the parts cheap. By the way... Outdated Xerox machines area great source for step-motors and power-electronics.)
I for instance will be very gratefull.
Seems a very good proyect.

DukerX 14-05-2003 05:17 PM

Okay... I´ve been doing some calculations and have found that the non-contact aproach just wouldn´t do. The accuracy is just too low if the scanning is to be completed within reasonable time. If I was to compensate for the lack of precision, it would take a whole day to scan the car, and that´s just too long, and I don´t think the 10$ microchip could handle the heavy calculations required either, so I have focused on the contact variaont, and found that it could be done quite easily. As a matter of fact, the microchip has an integrated UART, and therefore can be directly hooked up to the serial port of any computer, so the only thing I need to do is to write a maya-plugin that can receive the data from the COM port, and put it into 3D-world.

On the PC, I´ve been using "hyper terminal" to comunicate with the chip,and been able to send and receive data from it. It was even easier than I expected!
When the button on the scanner is pressed, the chip sends the coordinates to the COM-port, one byte at the time, and the data is sent back to the chip to verify it, and if it´s okay, it proceeds to the next byte.
Since hyper terminal is not a programming interface, I had to type the data back manually, but at least, it proves that it works. The only thing I need now, is a script sample on handling terminal functionality through the COM port, and it´s working (at least the comunication between MAYA and the scanner).
The next part wil be designing the position encoders, and get that data from the position sensors into the microchip, nd alsoensure the accuracy of the entire design. At this point I´ve encountered a problem. No matter how light-weight I make it, the material would still flex and bend when I move the point-scanner over the car surface, so I´m also working on a device to make it semi-automated, much in the same fashion as the power steering on a car.


Final note...
I could post code samples and scematics much like the WIP part of this forum, but the various parts wouldn´t be much good without the entire design, and they´re also due to change whenever I make modifications and improvements, but on the other hand, the people that reads this forum might get their own ideas, and could help me with the design.

Alan 15-05-2003 11:38 AM

If you can make the scanner dump out a text file of the co-ordinates in the form:

x,y,z trans I can give you a script to load them into maya. That would avoid the need to write a plugin. Does that help at all?

Alan

DukerX 17-05-2003 11:08 AM

Heeey! Pure_Morning! That's cool!

What kind of object is created in maya?... Or is that customisable??

Alan 19-05-2003 11:41 AM

Emmmm that's a good point, I'm not sure. I think we could make a poly out of it..... I guess. Hmmm that makes this seem harder than I had originally thought....

let me think about it.

Alan


All times are GMT. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018