program to view xml file in 3D

The new control algorithm for AutoQuad flight controllers.

Re: program to view xml file in 3D

Postby fred_fr » Thu May 21, 2015 8:32 am

hi

I have a problem with my web site.

You cand find in attachment the latest version :
convert.zip



Fred
fred
fred_fr
 
Posts: 75
Joined: Tue Aug 28, 2012 10:13 am
Location: france, Caluire et Cuire

Re: program to view xml file in 3D

Postby aBUGSworstnightmare » Thu May 21, 2015 5:00 pm

YES ... FRED CAN!

Hi Fred,
tested the latest convert util! Works as expected!
Attached to this post you find an interactive 3D .PDF-file generated from the unmodified .WRL output: Cube names are in place, arm length with custom mixer is correct.
Excellent work! I can highly encourage any QUATOS user to make use of it.
Joerg
rachel_0r1.pdf
rOsewhite Rachel
(40.49 KiB) Downloaded 172 times

3r1c.pdf
CamCruiser M4+QUATOS
(40.72 KiB) Downloaded 158 times


P.S. let's make a short game: first one to post the last remaining error in the 3r1c.xml file will win something ...
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: program to view xml file in 3D

Postby aBUGSworstnightmare » Thu May 21, 2015 6:03 pm

Hi,
seems like some people are struggling how to use this, so let me try to explain how I do it!

The convert tool is written in TCL language. To make use of it you need to have a TCL compiler installed. To be honest: I HAVE NO IDEA WHAT TCL IS! But, you may want to follow this easy steps to use it:

1. Download the TCL Compiler installation file. It is available free of cost for Windows, OS X, Linux.
http://www.activestate.com/activetcl/downloads

2. Run the installation routine
I'm using Windows 7 Pro 64-bit for development. Since you need to run the convert script from the command prompt (CMD) I've decided to install it into the root directory of my PC (C:)
installation folder.PNG
Install TCL compiler in C: (root of your HDD) - make using it a 'lil easier

3. Download the latest CONVERT.TCL script
At the time of writing you can find it in this post: viewtopic.php?f=48&t=4456&start=40#p32942
Check the thread for later version!

4. Place the script into the BIN folder of your TCL installation
placeinbin.PNG
copy convert.tcl script to bin folder of your installation

5. Edit your XML-file for QUATOS (or use one from my latest posts to test/start with) and place it in the tcl bin folder too
xmlstorage.PNG
Copy your QUATOS .XML file to bin folder

6. Start the console (command line) by clicking the Windows start button and typing CMD into the search box. Hit RETURN/ENTER!
startcmd.png
Command Prompt
startcmd.png (43.96 KiB) Viewed 5072 times

7. Command prompt is ready for duty
readyfor.PNG
readyfor.PNG (54.27 KiB) Viewed 5072 times

8. Don't know if you guys ever worked with DOS (if you need to use google to find out you didn't) so here's what to do next:
You need to change the working directory to use TCL from the command prompt.
The command to change one layer towards ROOT (C:) is cd..
The current directory for me is: C:\Users\admin
To get to ROOT I need to change directory twice --> type
cd.. -> hit enter
cd.. -> hit enter
Now I'm on ROOT level
root.PNG
root.PNG (34.59 KiB) Viewed 5072 times

To change to TCL/BIN I need to use the change directory cd command again --> type
cd tcl -> hit enter
cd bin -> hit enter
The command dir lists the content of this directory (optional! just to make sure we're there)
changetclbin.PNG
Now we're in the required directory to start using the tool!
changetclbin.PNG (61.9 KiB) Viewed 5072 times

9. Now you can convert to .XML-file into a 3D .WRL-file
I'm using the .XML-file for my Rachel quad for this example! So, the required command line is:

tclsh.exe convert.tcl rachel_0r1.xml rachel_0r1.wrl

with:
tclsh.exe - compiler for TCL language
convert.tcl - program to run
rachel_0r1.xml - XML input file
rachel_0r1.wrl - WRL output file

You can use whatever filename you want! Just make sure your input is a valid .XML-file and the extension for the output file is .wrl
run script.PNG
Start the conversion tool from the command line
run script.PNG (73.68 KiB) Viewed 5072 times

output.PNG
Output file is rachel_0r1.wrl - 3D model of your quad
output.PNG (67.84 KiB) Viewed 5072 times

10. Use a program to view WRL-files
One example is ORBISNAP (free of cost, find it here: http://www.orbisnap.com/download2.html). That's the one I used for most of the screenshots in this thread (the ones with a black background)
Another one - not free of cost - is 3D-TOOL (http://www.3d-tool.com). This is a commercial software but a test version is available too. I've used this tool to generate the 3D .PDF files and the screenshots with the gray background.
There are for sure other tools out there! If you find a nice - FREE - one post a link!

11. Re-View your 3D .WRL file and find possible errors!

Feel free to ask your questions here! Maybe Fred will also add something to this. As far as I know he's planning to have an easier to use (C-language) version of the convert tool soon.

Cheers
Joerg

P.S. The answer to my question is: left- and right skid names are mixed up!
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: program to view xml file in 3D

Postby kinderkram » Thu May 21, 2015 6:32 pm

Thx for the tool, Fred!
And thx for the tutorial, Joerg!

Once confirmed by Fred, I will transfer it to the Wiki.
kinderkram
 
Posts: 2911
Joined: Fri Jun 22, 2012 7:47 am

Re: program to view xml file in 3D

Postby aBUGSworstnightmare » Fri May 22, 2015 9:39 pm

Hi Fred,

please test hexa X and Hexa Plus config! There is a problem with Hex_plus! Hex x seems to be o.k. on first view.
Code: Select all
<?xml version="1.0"?>
<!--
 hexa plus example
 -->
<quatos_configuration>
    <craft id="Alain_Hexa" config="hex_plus">
        <ports>
            <port rotation="+1">1</port>
            <port rotation="-1">2</port>
            <port rotation="+1">3</port>
            <port rotation="-1">4</port>
            <port rotation="+1">5</port>
            <port rotation="-1">6</port>
        </ports>
       
        <distance>
            <motor>0.277</motor>
        </distance>
       
        <mass>
            <!-- define your masses in the MASS section -->
           
            <motor>100</motor>
       
            <arm>45</arm>
           
            <esc>0</esc>
           
            <!--
             M4 - located 2cm above COG
            -->
            <cube name="M4" dimx="0.036" dimy="0.036" dimz="0.0016" offsetx="0" offsety="0" offsetz="-0.02">10</cube>
           
        </mass>
    </craft>
</quatos_configuration>


Joerg
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: program to view xml file in 3D

Postby plexus » Sat May 23, 2015 9:11 am

Hi fred
Last convert, and TCL8.5, and under win7.

the file is here:
essai6.xml
(1.02 KiB) Downloaded 148 times

The screenshot:

tcl.jpg
tcl.jpg (19.13 KiB) Viewed 5034 times

Thanks for your help.
Alain
Last edited by plexus on Sat May 23, 2015 9:14 am, edited 1 time in total.
plexus
 
Posts: 534
Joined: Tue Jul 03, 2012 3:30 pm
Location: South of France

Re: program to view xml file in 3D

Postby aBUGSworstnightmare » Sat May 23, 2015 9:14 am

Hey guys,

prepared another example for you: an RCtimer SPIDER FPV frame.

I have one of the frame kits lying around. Will try to make it fly - using some more low-end stuff (i.e. Turing motors from my test-rig). Let's see how QUATOS copes with such a frame.
Will open a new thread for this once started!

So, back to the cool tool (!) from Fred:
Here is the .XML-file for the Spider
rctspider_0r1.xml
.XML-file for the RCtimer Spider FPV frame - example for another asymmetrical frame
(9.85 KiB) Downloaded 187 times

rctspider_0r1.wrl.zip
... this is what Fred's tool gives you - changes the colors for a better overview
(3.93 KiB) Downloaded 149 times

rctspider_0r1.jpg
... this is what the recolored .WRL looks like

rctspider_0r1.pdf
... and here is something for you guys to play with
(42.44 KiB) Downloaded 151 times


Cheers
Joerg
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: program to view xml file in 3D

Postby plexus » Sat May 23, 2015 9:30 am

Hi joerg,
good job.
Your file run well with convert !

Alain
plexus
 
Posts: 534
Joined: Tue Jul 03, 2012 3:30 pm
Location: South of France

Re: program to view xml file in 3D

Postby fred_fr » Sat May 23, 2015 3:39 pm

hi

You can find the corrected version in attachement :
convert.zip


fred
fred
fred_fr
 
Posts: 75
Joined: Tue Aug 28, 2012 10:13 am
Location: france, Caluire et Cuire

Re: program to view xml file in 3D

Postby plexus » Sat May 23, 2015 5:39 pm

Thanks fred, that run now, see my hexa:
hexa.jpg
hexa.jpg (19.44 KiB) Viewed 5001 times

It is very usefull to see the parts and there positions.

Anyway one question: how to give a dimension to the arms, drawing my arms are rectangular instead of being square. This is a profile of 11.5X11.5 ?
Alain
plexus
 
Posts: 534
Joined: Tue Jul 03, 2012 3:30 pm
Location: South of France

PreviousNext

Return to Quatos Adaptive Control

Who is online

Users browsing this forum: No registered users and 0 guests