https://pymolwiki.org/index.php?title=Collada_geometry_mode&feed=atom&action=historyCollada geometry mode - Revision history2024-03-29T10:55:22ZRevision history for this page on the wikiMediaWiki 1.35.7https://pymolwiki.org/index.php?title=Collada_geometry_mode&diff=11986&oldid=prevJaredsampson: Created2015-05-20T22:52:24Z<p>Created</p>
<p><b>New page</b></p><div>'''Collada geometry mode''' controls the types of <code>geometry</code> elements used in [[COLLADA]] output. Different modes can be useful depending on how the output file will be used, as different graphics viewing and editing applications have varying levels of support for the various features of the COLLADA [https://www.khronos.org/files/collada_spec_1_4.pdf specification].<br />
<br />
=Values=<br />
Currently there are 2 modes implemented for COLLADA geometry export.<br />
* '''0''': (default) Use any valid COLLADA 1.4.1 elements, including <code>triangles</code>, <code>trifans</code>, <code>tristrips</code> and <code>polylist</code>, etc. This is the recommended mode for most applications, including Apple's Preview and iBooks/iBooks Author.<br />
* '''1''': Blender-compatible mode. Use only <code>polylist</code> elements. This generally results in a larger file size, as <code>polylist</code> elements require explicit data for things like the number of vertices in each polygon (<code><vcount></code>), whereas the more specific elements like <code>triangles</code> do not (by definition, each triangle has 3 vertices).<br />
<br />
=Syntax=<br />
<source lang="python"><br />
set collada_geometry_mode, 0 # Valid COLLADA 1.4.1 (default)<br />
set collada_geometry_mode, 1 # Blender-compatible mode<br />
</source><br />
<br />
=Example=<br />
The following script creates two output files containing a single cylinder, one with the default collada_geometry_mode set to 0 (cgm0.dae) and the other set to 1 (cgm1.dae). <br />
<source lang="python"><br />
reinitialize<br />
pseudoatom ps1, pos=[-0.5,0,0]<br />
pseudoatom ps2, pos=[0.5,0,0]<br />
hide nonbonded<br />
distance d, ps1, ps2<br />
set dash_round_ends, 0<br />
set dash_gap, 0<br />
hide labels, d<br />
save cgm0.dae<br />
set collada_geometry_mode, 1<br />
save cgm1.dae<br />
</source><br />
Running <code>diff cgm0.dae cgm1.dae</code> on the two output files results in the following output, indicating that for collada_geometry_mode=1, <code>polylist</code> elements were used to create the ends of the cylinder, rather than <code>triangle</code> elements.<br />
<source lang="diff"><br />
70c70<br />
< <triangles count="8" material="geom0-material"><br />
---<br />
> <polylist count="8" material="geom0-material"><br />
73a74<br />
> <vcount>3 3 3 3 3 3 3 3 </vcount><br />
75,76c76,77<br />
< </triangles><br />
< <triangles count="8" material="geom0-material"><br />
---<br />
> </polylist><br />
> <polylist count="8" material="geom0-material"><br />
79a81<br />
> <vcount>3 3 3 3 3 3 3 3 </vcount><br />
81c83<br />
< </triangles><br />
---<br />
> </polylist><br />
</source><br />
<br />
=See also=<br />
* [[COLLADA]]</div>Jaredsampson