<div dir="ltr">Here is an inquiry from github which seems better suited to the mailing lists.<div><br></div><div>-Andreas<br><br><div class="gmail_quote"><div dir="ltr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">theveloped</strong> <span dir="ltr"><<a href="mailto:notifications@github.com" target="_blank">notifications@github.com</a>></span><br>Date: Thu, Dec 20, 2018 at 5:40 AM<br>Subject: [x3dom/x3dom] Best approach to visualize of dimensions  (PMI data) (#913)<br>To: x3dom/x3dom <<a href="mailto:x3dom@noreply.github.com" target="_blank">x3dom@noreply.github.com</a>><br>Cc: Subscribed <<a href="mailto:subscribed@noreply.github.com" target="_blank">subscribed@noreply.github.com</a>><br></div><br><br><p>Does anyone have any experience with the visualization of model dimensions and other model-related information in an x3dom instance? For our final solution, we would like to show all the PMI data of an object as per the examples of NIST: <a href="https://pages.nist.gov/CAD-PMI-Testing/graphical-pmi-viewer.html" rel="nofollow" target="_blank">https://pages.nist.gov/CAD-PMI-Testing/graphical-pmi-viewer.html</a></p>
<p>To get started we would like to show the three dimensions of the bounding box in a using leaders aligned to the bounding box:<br>
<a rel="noopener noreferrer" href="https://camo.githubusercontent.com/1df1afb03290cc8087a2b1791c90c9b712692d90/68747470733a2f2f69302e77702e636f6d2f7777772e6e6569742e6564752f626c6f672f77702d636f6e74656e742f75706c6f6164732f323031352f30392f49736f2d372e6a7067" target="_blank"><img src="https://camo.githubusercontent.com/1df1afb03290cc8087a2b1791c90c9b712692d90/68747470733a2f2f69302e77702e636f6d2f7777772e6e6569742e6564752f626c6f672f77702d636f6e74656e742f75706c6f6164732f323031352f30392f49736f2d372e6a7067" alt="example of isometric aligned dimensioning" style="max-width:100%"></a><br>
Idealy of the the 12 edges of the bounding box we would constantly show the 3 perpendicular edges that are best visible.</p>
<p>Any idea's on the subject are most welcome. At the moment we are mainly looking at:</p>
<ul>
<li><a href="https://pages.nist.gov/CAD-PMI-Testing/graphical-pmi-viewer.html" rel="nofollow" target="_blank">NIST PMI examples</a>(no info on the generation of the x3d)</li>
<li><a href="https://github.com/ghemingway/cad.js/tree/master" target="_blank">cadjs</a> (uses threejs over x3dom)</li>
</ul>
<p>For reference the bounding box dimensions/position of an x3d element can be computed using the is currently computed using:</p>
<pre><code>compute_boundingbox: function(part) {
        var node = part._x3domNode
        var volume = node.getVolume();

        var min = new x3dom.fields.SFVec3f();
        var max = new x3dom.fields.SFVec3f();

        volume.getBounds(min, max);

        var dimensions = max.subtract(min);
        var position = volume.center

        console.log("Dimensions: " + dimensions.x + " " + dimensions.y + " " + dimensions.z);
        console.log("Position: " + position.x + " " + position.y + " " + position.z);
    },
</code></pre>

<p style="font-size:small;color:#666">—<br>You are receiving this because you are subscribed to this thread.<br>Reply to this email directly, <a href="https://github.com/x3dom/x3dom/issues/913" target="_blank">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF4p60WEngT8eCA5jnu-rPw8G03wMvS9ks5u62kUgaJpZM4Zb7cb" target="_blank">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF4p66w1E71DNTv-56IjyydfsK1Kbp_aks5u62kUgaJpZM4Zb7cb.gif" height="1" width="1" alt=""></p>

</div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_374177103602903005gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Andreas Plesch<br>Waltham, MA 02453</div></div></div></div></div>