Answer the question
In order to leave comments, you need to log in
How to decode 3D shapes in xml?
I converted a 3d figure from one design program to xml. Now we need to decipher it somehow. Tell me how this code is deciphered:
Cube 100 * 100 * 100mm:
<?xml version="1.0" encoding="windows-1251" ?>
<scene>
<layer>
<shape thickness="0.018">
<matrix>
0.000000000000003, 0.000000000000005, -5.555555555555510, -1.950000000000001,
0.000000000000000, -1.000000000000000, 0.000000000000000, -1.375000000000000,
-1.000000000000000, 0.000000000000000, 0.000000000000000, -1.875000000000000,
0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000
</matrix>
<segments>
<line>0.025, 0.025</line>
<line>0.025, 0.125</line>
<line>0.125, 0.125</line>
<line>0.125, 0.025</line>
</segments>
</shape>
</layer>
</scene>
<?xml version="1.0" encoding="windows-1251" ?>
<scene>
<layer>
<shape thickness="0.018">
<matrix>
0.000000000000003, 0.000000000000005, -0.055555555555555, -1.999500000000000,
0.000000000000000, -1.000000000000000, 0.000000000000000, -1.498750000000000,
-1.000000000000000, 0.000000000000000, 0.000000000000000, -1.998750000000000,
0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000
</matrix>
<segments>
<line>0.000, 0.000</line>
<line>0.000, 0.001</line>
<line>0.001, 0.001</line>
<line>0.001, 0.000</line>
</segments>
</shape>
</layer>
</scene>
Answer the question
In order to leave comments, you need to log in
It's like extrusion.
That is, a 2D figure is drawn and extruded to the desired thickness.
In your case, a square is drawn by listing the 2D coordinates of its vertices (x, y):
<segments>
<line>0.000, 0.000</line>
<line>0.000, 0.001</line>
<line>0.001, 0.001</line>
<line>0.001, 0.000</line>
</segments>
<matrix>
0.000000000000003, 0.000000000000005, -0.055555555555555, -1.999500000000000,
0.000000000000000, -1.000000000000000, 0.000000000000000, -1.498750000000000,
-1.000000000000000, 0.000000000000000, 0.000000000000000, -1.998750000000000,
0.000000000000000, 0.000000000000000, 0.000000000000000, 1.000000000000000
</matrix>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question