tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/5408-fit-rect-to-bound-of-imported-svgNodeBox: Discussion 2015-02-28T10:02:45Ztag:support.nodebox.net,2012-11-01:Comment/361529122015-02-27T10:24:24Z2015-02-27T10:24:24Zfit rect to bound of imported svg<div><p>Here is one way...</p>
<ul>
<li>Set the rect position to the centroid of the svg</li>
<li>Set the rect width to a lookup on the svg with a key of
"bounds.width"</li>
<li>Set the rect height to a lookup on the svg with a key of
"bounds.height"</li>
</ul>
<p>The attached zip file contains a NodeBox document that does this
along with an svg of a world map you can use to test it. To keep
things tidy I colorized the rect to make the fill transparent with
a black stroke width of 1, then combined the rect with the original
svg to create a world map with a rectangular frame. Give it a few
seconds to render.</p>
<p>Hope that helps!</p>
<p>John</p></div>johntag:support.nodebox.net,2012-11-01:Comment/361529122015-02-27T21:43:32Z2015-02-27T21:43:32Zfit rect to bound of imported svg<div><p>ah ! of course, brilliant.</p>
<p>I was getting part of the way there by using a lookup, but
didn't expose the properties of bound in terms of height and
width.</p>
<p>thankyou !</p></div>flametag:support.nodebox.net,2012-11-01:Comment/361529122015-02-28T10:02:44Z2015-02-28T10:02:44Zfit rect to bound of imported svg<div><p>Use the “fit to” node to fit one node to
another.</p>
<p><a href=
"https://www.nodebox.net/node/reference/corevector/fit_to">https://www.nodebox.net/node/reference/corevector/fit_to</a></p>
<p>Grtz,</p>
<p>F</p></div>Frederik De Bleser