<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[help: Import DXF and calculate bounding box]]></title><description><![CDATA[<p dir="auto">I'm new to JSCAD.</p>
<p dir="auto">Here is my use case:  As a web user, I can load a DXF file so that we can automatically calculate the bounding box around the object.</p>
<p dir="auto">How do I do this?</p>
]]></description><link>https://openjscad.nodebb.com/topic/316/help-import-dxf-and-calculate-bounding-box</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 20:14:15 GMT</lastBuildDate><atom:link href="https://openjscad.nodebb.com/topic/316.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Nov 2021 03:35:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to help: Import DXF and calculate bounding box on Sat, 06 Nov 2021 12:48:56 GMT]]></title><description><![CDATA[<p dir="auto">Sorry… that documentation is not complete. We will have to make some updates. <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=552b9a4dc0c" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":(" alt="😞" /></p>
<p dir="auto">There’s <a href="https://openjscad.xyz/docs/module-modeling_measurements.html#.measureBoundingBox" rel="nofollow ugc">slightly better documentation here</a>.</p>
<p dir="auto">Basically, your design needs to call measureBoudingBox(shape), which returns an array of points, lower and upper bounds.</p>
]]></description><link>https://openjscad.nodebb.com/post/1003</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1003</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Sat, 06 Nov 2021 12:48:56 GMT</pubDate></item><item><title><![CDATA[Reply to help: Import DXF and calculate bounding box on Sat, 06 Nov 2021 12:39:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/z3dev" aria-label="Profile: z3dev">@<bdi>z3dev</bdi></a> thank you so much, that helped with the loading of the DXF!</p>
<p dir="auto">Few more questions if you don't mind.</p>
<p dir="auto">I've taken "contents" and want to get the bounding box for it so I can determine its size.  I read there a "getBounds()" that can be used:  <a href="https://openjscad.xyz/dokuwiki/doku.php?id=en:design_guide_measurements" rel="nofollow ugc">https://openjscad.xyz/dokuwiki/doku.php?id=en:design_guide_measurements</a><br />
But contents itself doesnt have a method - ie contents.getBounds() doesnt exist.  I probably don't understand the data model here I will admit.</p>
]]></description><link>https://openjscad.nodebb.com/post/1002</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1002</guid><dc:creator><![CDATA[Ashish]]></dc:creator><pubDate>Sat, 06 Nov 2021 12:39:27 GMT</pubDate></item><item><title><![CDATA[Reply to help: Import DXF and calculate bounding box on Sat, 06 Nov 2021 04:34:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ashish" aria-label="Profile: Ashish">@<bdi>Ashish</bdi></a> Welcome!</p>
<p dir="auto">There are a couple of ways to do this but let's just use the WEB UI (website).</p>
<p dir="auto">The best way to do this is by making a project (directory) and put the parts into the directory.</p>
<ul>
<li>Create a directory, e.g. newdesign</li>
<li>Copy the pieces into the 'newdesign' directory, both index.js and my.dxf</li>
<li>Load the DXF as part of the design</li>
</ul>
<pre><code>const { transforms } = require('@jscad/modeling')

const main = () =&gt; {
  let contents = require('./my.dxf')
  contents = transforms.scale([5, 5, 5], contents)
  // and measure, etc
  return contents
}
</code></pre>
<p dir="auto">Once ready, drag and drop the 'newdesign' directory to the website.</p>
]]></description><link>https://openjscad.nodebb.com/post/1001</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1001</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Sat, 06 Nov 2021 04:34:25 GMT</pubDate></item></channel></rss>