<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: DSL for Drawing Floor Plans</title>
	<atom:link href="http://nklein.com/2009/10/dsl-for-drawing-floor-plans/feed/" rel="self" type="application/rss+xml" />
	<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/</link>
	<description>software development and consulting</description>
	<lastBuildDate>Sun, 20 May 2012 18:07:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: pat</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-465</link>
		<dc:creator>pat</dc:creator>
		<pubDate>Tue, 24 Nov 2009 03:49:07 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-465</guid>
		<description>I certainly will post the code.  My immediate need for it has passed.  So, I may post the partial stuff sooner if I don&#039;t get back to it.</description>
		<content:encoded><![CDATA[<p>I certainly will post the code.  My immediate need for it has passed.  So, I may post the partial stuff sooner if I don&#8217;t get back to it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dc</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-464</link>
		<dc:creator>dc</dc:creator>
		<pubDate>Tue, 24 Nov 2009 03:33:56 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-464</guid>
		<description>Hi Pat,
Would you think about putting the code up on the site when you&#039;re done?

I quite like the idea of being able to describe a house plan in a DSL. I&#039;m thinking about doing the same thing as you (building a house) and would like to be able to generate a floor plan from code.

I&#039;ll check back every now and then.
Thanks</description>
		<content:encoded><![CDATA[<p>Hi Pat,<br />
Would you think about putting the code up on the site when you&#8217;re done?</p>
<p>I quite like the idea of being able to describe a house plan in a DSL. I&#8217;m thinking about doing the same thing as you (building a house) and would like to be able to generate a floor plan from code.</p>
<p>I&#8217;ll check back every now and then.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-453</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Mon, 02 Nov 2009 16:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-453</guid>
		<description>fyi, Harvey&#039;s been pushing TikZ at me for a while now.  :-)</description>
		<content:encoded><![CDATA[<p>fyi, Harvey&#8217;s been pushing TikZ at me for a while now.  <img src='http://nklein.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pat</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-451</link>
		<dc:creator>pat</dc:creator>
		<pubDate>Sat, 31 Oct 2009 00:21:03 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-451</guid>
		<description>I&#039;m still not satisfied with the intermediate-forms thing.  But, I don&#039;t see a way around it if I want to scale things to fit perfectly at a fixed resolution (unless I make the user pre-determine the needed scaling).  I think an alternate approach to the intermediate-forms would be to do things with generic functions that specialize off the renderer.  So, you might have:
[cc lang=&quot;lisp&quot;]
(defmethod draw-door (renderer &amp;params-related-to-doors)
  ...
  (draw-line renderer pt-a pt-b :weight 2)
  (draw-arc renderer center angle-1 angle-2 :weight 1))
[/cc]

Then, you would specialize &lt;b&gt;draw-line&lt;/b&gt; and &lt;b&gt;draw-arc&lt;/b&gt; based on the renderer.
[cc lang=&quot;lisp&quot; first_line=&quot;5&quot;]
(defmethod draw-line ((render opengl-renderer) pt-a pt-b &amp;key (weight 1))
  ...)
(defmethod draw-line ((render cl-pdf-renderer) pt-a pt-b &amp;key (weight 1))
  ...)
[/cc]

Still cogitating....  Thanks for the input.</description>
		<content:encoded><![CDATA[<p>I&#8217;m still not satisfied with the intermediate-forms thing.  But, I don&#8217;t see a way around it if I want to scale things to fit perfectly at a fixed resolution (unless I make the user pre-determine the needed scaling).  I think an alternate approach to the intermediate-forms would be to do things with generic functions that specialize off the renderer.  So, you might have:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>defmethod draw-door <span style="color: #66cc66;">&#40;</span>renderer <span style="color: #66cc66;">&amp;</span>params-related-to-doors<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">...</span>
  <span style="color: #66cc66;">&#40;</span>draw-line renderer pt-a pt-b <span style="color: #66cc66;">:</span><span style="color: #555;">weight</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>draw-arc renderer center angle-<span style="color: #cc66cc;">1</span> angle-<span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">:</span><span style="color: #555;">weight</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>Then, you would specialize <b>draw-line</b> and <b>draw-arc</b> based on the renderer.</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>defmethod draw-line <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>render opengl-renderer<span style="color: #66cc66;">&#41;</span> pt-a pt-b <span style="color: #66cc66;">&amp;</span>key <span style="color: #66cc66;">&#40;</span>weight <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>defmethod draw-line <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>render cl-pdf-renderer<span style="color: #66cc66;">&#41;</span> pt-a pt-b <span style="color: #66cc66;">&amp;</span>key <span style="color: #66cc66;">&#40;</span>weight <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>Still cogitating&#8230;.  Thanks for the input.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raito</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-450</link>
		<dc:creator>raito</dc:creator>
		<pubDate>Fri, 30 Oct 2009 20:40:40 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-450</guid>
		<description>Pat,

CAD is pretty well locked up into expensive stuff like AutoCAD, or cheapie programs that do little.

I mean programs like AutoCAD, not necessarily Lisp code. I meant for you to look over how those programs work, and make your stuff work that way (because the CAD guys have done all this before). Look for AutoCAD packages. AutoLisp isn&#039;t Common Lisp, but it&#039;s close enough to figure out what to do. Look in places like this:

http://www.cadinfo.net/scripts/lisplib-software.cfm?areano=56

I&#039;d also look at tutorials for AutoCAD or SolidWorks to see how they enter things like absolute coordinates and relative coordinates in their command lines.

What I wanted was very similar to what you wanted: a DSL for some graphic operations that I could sue to write programs that output to either OpenGL (for interaction), or DXF (to send to other people).

My impetus is that I&#039;m designing a new house. So I wanted to be able to use Lisp forms to describe the house. Didn&#039;t make it there the first time -- I had Lisp code that described it. I have a pretty good background in OpenGL (been doing it since it was IrisGL), but little in CFFI so I&#039;m of little use to the cl-opengl guys. And I also have done a lot of stuff in AutoCAD, and have a bit of code lying around that&#039;s a sort of bad DSL for DXFs. really it&#039;s just a with-open-dxf kind of thing and functions that write out the various elements.

So I had a program that drew my house, with code that looked like:
[cc lang=&quot;lisp&quot;]
(defun draw-door (w x y z a r &amp;optional (th 4))
  (if (wire w)
    (draw-door-w x y z a r th)
    (draw-door-t w x y z a r th)))
[/cc]
This isn&#039;t so good, because I now have to write both the wireframe function and the texture function. And I&#039;d have to add another in order to do DXf output.

So my solution is to do something like:
[cc lang=&quot;lisp&quot; first_line=&quot;5&quot;]
(defun draw-door (w x y z a r &amp;optional (th 4))
  (add-line yadda yadda) ...)
[/cc]

to create an intermediate format. Then I&#039;d instruct some renderer to use that format for its output. That output could be to my standard OpenGL model viewer in either wireframe or textured mode, or a DXF renderer, or PDF, or whatever.

You probably won&#039;t find too much of my code out in the world. Though I&#039;ve been doing code since the mid-70&#039;s, I&#039;ve only been doing Lisp for a few years. And most of my stuff is copyrighted by my employers.</description>
		<content:encoded><![CDATA[<p>Pat,</p>
<p>CAD is pretty well locked up into expensive stuff like AutoCAD, or cheapie programs that do little.</p>
<p>I mean programs like AutoCAD, not necessarily Lisp code. I meant for you to look over how those programs work, and make your stuff work that way (because the CAD guys have done all this before). Look for AutoCAD packages. AutoLisp isn&#8217;t Common Lisp, but it&#8217;s close enough to figure out what to do. Look in places like this:</p>
<p><a href="http://www.cadinfo.net/scripts/lisplib-software.cfm?areano=56" rel="nofollow">http://www.cadinfo.net/scripts/lisplib-software.cfm?areano=56</a></p>
<p>I&#8217;d also look at tutorials for AutoCAD or SolidWorks to see how they enter things like absolute coordinates and relative coordinates in their command lines.</p>
<p>What I wanted was very similar to what you wanted: a DSL for some graphic operations that I could sue to write programs that output to either OpenGL (for interaction), or DXF (to send to other people).</p>
<p>My impetus is that I&#8217;m designing a new house. So I wanted to be able to use Lisp forms to describe the house. Didn&#8217;t make it there the first time &#8212; I had Lisp code that described it. I have a pretty good background in OpenGL (been doing it since it was IrisGL), but little in CFFI so I&#8217;m of little use to the cl-opengl guys. And I also have done a lot of stuff in AutoCAD, and have a bit of code lying around that&#8217;s a sort of bad DSL for DXFs. really it&#8217;s just a with-open-dxf kind of thing and functions that write out the various elements.</p>
<p>So I had a program that drew my house, with code that looked like:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> draw-door <span style="color: #66cc66;">&#40;</span>w x y z a r <span style="color: #66cc66;">&amp;</span>amp<span style="color: #808080; font-style: italic;">;optional (th 4))</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>wire w<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>draw-door-w x y z a r th<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>draw-door-t w x y z a r th<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>This isn&#8217;t so good, because I now have to write both the wireframe function and the texture function. And I&#8217;d have to add another in order to do DXf output.</p>
<p>So my solution is to do something like:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> draw-door <span style="color: #66cc66;">&#40;</span>w x y z a r <span style="color: #66cc66;">&amp;</span>amp<span style="color: #808080; font-style: italic;">;optional (th 4))</span>
  <span style="color: #66cc66;">&#40;</span>add-line yadda yadda<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>to create an intermediate format. Then I&#8217;d instruct some renderer to use that format for its output. That output could be to my standard OpenGL model viewer in either wireframe or textured mode, or a DXF renderer, or PDF, or whatever.</p>
<p>You probably won&#8217;t find too much of my code out in the world. Though I&#8217;ve been doing code since the mid-70&#8242;s, I&#8217;ve only been doing Lisp for a few years. And most of my stuff is copyrighted by my employers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pat</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-448</link>
		<dc:creator>pat</dc:creator>
		<pubDate>Thu, 29 Oct 2009 16:04:55 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-448</guid>
		<description>What CAD stuff?  I looked at the Cliki, and the only entry under CAD is for electronic circuit design.  I look every five or six months for decent, cheap 2D/3D CAD stuff for designing woodworking projects, but never come up satisfied.  Any recommendations?

You mention that your output is DXF or OpenGL.  Your output from what?  I&#039;m having trouble Googling you by nym.  (Actually, &lt;q&gt;raito lisp&lt;/q&gt; and &lt;q&gt;raito opengl&lt;/q&gt; both turn up lots of hits about cl-opengl where I cannot find &lt;q&gt;raito&lt;/q&gt; in the body of the page at all.)  I&#039;d be interested to see what you&#039;re working on.

I have been considering an cl-opengl floor-planning tool.  I thought an intermediate language that produced nice output files was a simpler starting point for that since I wouldn&#039;t have to deal with fonts in cl-opengl or keyboard input or mouse selection and stuff that would distract from what I really want right away:  a nice looking floor plan.</description>
		<content:encoded><![CDATA[<p>What CAD stuff?  I looked at the Cliki, and the only entry under CAD is for electronic circuit design.  I look every five or six months for decent, cheap 2D/3D CAD stuff for designing woodworking projects, but never come up satisfied.  Any recommendations?</p>
<p>You mention that your output is DXF or OpenGL.  Your output from what?  I&#8217;m having trouble Googling you by nym.  (Actually, <q>raito lisp</q> and <q>raito opengl</q> both turn up lots of hits about cl-opengl where I cannot find <q>raito</q> in the body of the page at all.)  I&#8217;d be interested to see what you&#8217;re working on.</p>
<p>I have been considering an cl-opengl floor-planning tool.  I thought an intermediate language that produced nice output files was a simpler starting point for that since I wouldn&#8217;t have to deal with fonts in cl-opengl or keyboard input or mouse selection and stuff that would distract from what I really want right away:  a nice looking floor plan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pat</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-447</link>
		<dc:creator>pat</dc:creator>
		<pubDate>Thu, 29 Oct 2009 15:57:08 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-447</guid>
		<description>Inkscape is okay.  I&#039;m much more comfortable in OmniGraffle or Gimp, but Gimp is fixed-resolution.  I suppose I should get used to Inkscape.</description>
		<content:encoded><![CDATA[<p>Inkscape is okay.  I&#8217;m much more comfortable in OmniGraffle or Gimp, but Gimp is fixed-resolution.  I suppose I should get used to Inkscape.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pat</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-446</link>
		<dc:creator>pat</dc:creator>
		<pubDate>Thu, 29 Oct 2009 15:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-446</guid>
		<description>Yes, I think for walls, one probably often wants to say, the wall is 10-feet long, then bends and goes 8-feet.  But, certainly, I would want ways to store (push/pop) new base positions so that I could build some portions relative to the room they are in instead of relative to the global origin.

I had thought about trying to specify rooms in terms of volumes instead... this room is the union of a rectangle this big and a rectangle this big where the bottom-left corner of the first rectangle is two feet further down the page than the bottom-right corner of the second rectangle.  This makes inside-measurements vs. center-of-wall measurements easier.  It makes marking exterior walls vs. internal walls harder unless one assumes that the exterior walls are obviously all walls on the exterior of the drawn portion.  It does make doors easier though with things like: this room&#039;s door is five feet left of the bottom right corner and opens into the room.</description>
		<content:encoded><![CDATA[<p>Yes, I think for walls, one probably often wants to say, the wall is 10-feet long, then bends and goes 8-feet.  But, certainly, I would want ways to store (push/pop) new base positions so that I could build some portions relative to the room they are in instead of relative to the global origin.</p>
<p>I had thought about trying to specify rooms in terms of volumes instead&#8230; this room is the union of a rectangle this big and a rectangle this big where the bottom-left corner of the first rectangle is two feet further down the page than the bottom-right corner of the second rectangle.  This makes inside-measurements vs. center-of-wall measurements easier.  It makes marking exterior walls vs. internal walls harder unless one assumes that the exterior walls are obviously all walls on the exterior of the drawn portion.  It does make doors easier though with things like: this room&#8217;s door is five feet left of the bottom right corner and opens into the room.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pat</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-445</link>
		<dc:creator>pat</dc:creator>
		<pubDate>Thu, 29 Oct 2009 15:48:30 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-445</guid>
		<description>I tried using SweetHome3d about six months ago to map out one, small, square bedroom.  I suppose it worked, but I didn&#039;t like any of the output or the input.</description>
		<content:encoded><![CDATA[<p>I tried using SweetHome3d about six months ago to map out one, small, square bedroom.  I suppose it worked, but I didn&#8217;t like any of the output or the input.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: raito</title>
		<link>http://nklein.com/2009/10/dsl-for-drawing-floor-plans/comment-page-1/#comment-444</link>
		<dc:creator>raito</dc:creator>
		<pubDate>Thu, 29 Oct 2009 15:24:31 +0000</pubDate>
		<guid isPermaLink="false">http://nklein.com/?p=999#comment-444</guid>
		<description>Well, my output media are either DXF files (for CAD) or OpenGL (using cl-opengl if I&#039;m in Lisp). Regardless of my solution (whihc involves essentially rendering to Lisp forms so that I can pre-compute the output for either media without having to do calulations during the output), you might try looking up some of the CAD solutions to this problems for ideas. There are scores of CAD packages out there that do the same thing that you&#039;re (and I&#039;m) trying to do. And all (decent) CAD stuff can do things like relative measurements. You&#039;re kinda trying to reinvent the wheel (not that I&#039;m opposed ot that sort of thing).</description>
		<content:encoded><![CDATA[<p>Well, my output media are either DXF files (for CAD) or OpenGL (using cl-opengl if I&#8217;m in Lisp). Regardless of my solution (whihc involves essentially rendering to Lisp forms so that I can pre-compute the output for either media without having to do calulations during the output), you might try looking up some of the CAD solutions to this problems for ideas. There are scores of CAD packages out there that do the same thing that you&#8217;re (and I&#8217;m) trying to do. And all (decent) CAD stuff can do things like relative measurements. You&#8217;re kinda trying to reinvent the wheel (not that I&#8217;m opposed ot that sort of thing).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

