<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Floorplanner Tech Blog &#187; CAD</title>
	<atom:link href="http://techblog.floorplanner.com/category/cad/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.floorplanner.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 19 Nov 2009 04:00:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Papervision3D forum</title>
		<link>http://techblog.floorplanner.com/2009/01/20/papervision3d-forum/</link>
		<comments>http://techblog.floorplanner.com/2009/01/20/papervision3d-forum/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 15:45:34 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Floorplanner]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[forum]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=415</guid>
		<description><![CDATA[On request of many: Papervision3D now has a forum : http://forum.papervision3d.org/
Read more at the Papervision3D blog.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F01%2F20%2Fpapervision3d-forum%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F01%2F20%2Fpapervision3d-forum%2F" height="61" width="51" /></a></div><p>On request of many: Papervision3D now has a forum : http://forum.papervision3d.org/</p>
<p>Read more at the <a href="http://blog.papervision3d.org/2009/01/19/forumpapervision3dorg/">Papervision3D blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2009/01/20/papervision3d-forum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alchemy &#8211; first looks</title>
		<link>http://techblog.floorplanner.com/2008/11/23/alchemy-first-looks/</link>
		<comments>http://techblog.floorplanner.com/2008/11/23/alchemy-first-looks/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 15:30:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Floorplanner]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[alchemy flash as3 swc triangulation]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=261</guid>
		<description><![CDATA[Adobe has recently released a preview version of Alchemy. From their site:
Welcome the preview release of codename &#8220;Alchemy.&#8221; Alchemy is a research project that allows users to compile C and C++ code that is targeted to run on the open source ActionScript Virtual Machine (AVM2). The purpose of this preview is to assess the level [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2008%2F11%2F23%2Falchemy-first-looks%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2008%2F11%2F23%2Falchemy-first-looks%2F" height="61" width="51" /></a></div><p>Adobe has recently released a preview version of <a href="http://labs.adobe.com/technologies/alchemy/">Alchemy</a>. From their site:</p>
<blockquote><p>Welcome the preview release of codename &#8220;Alchemy.&#8221; Alchemy is a research project that allows users to compile C and C++ code that is targeted to run on the open source ActionScript Virtual Machine (AVM2). The purpose of this preview is to assess the level of community interest in reusing existing C and C++ libraries in Web applications that run on Adobe® Flash® Player and Adobe AIR®.</p></blockquote>
<p>So, what does this mean? This means that we can use existing C/C++ code and compile that down to AS3. Initially I though that this implied a hefty increase in code execution speed, but as all is compiled down to AS3 this is <strong>not</strong> true in most cases. Code will only run faster if you &#8217;stay&#8217; on the C-side and only return to &#8216;AS3&#8242; when your C code is done processing. The reason is that AS3 method-calls are sloooow (params need to be &#8216;unboxed&#8217; etc.)! When in C this slowness doesn&#8217;t occur and hence execution speed will be faster (Adobe claims a potential speed increase by a factor 2 to 10 I beleive). Wow! That of course made me wonder whether Alchemy would be usefull for 3D engines like Papervision3D, more soon! <img src='http://techblog.floorplanner.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://www.automatastudios.com">Branden Hall</a> did a nice <a href="http://www.automatastudios.com/2008/11/21/understanding-adobe-alchemy/">writeup</a> on Alchemy explaining above better then me.</p>
<p>I couldn&#8217;t resist myself and started off immediately with something I always wanted to code for our 3D engine: <a href="http://en.wikipedia.org/wiki/Polygon_triangulation">Polygon Triangulation</a> with support for holes.</p>
<p>I installed the <a href="http://labs.adobe.com/downloads/alchemy.html">Alchemy Toolkit</a>, got the Flex 3.2 SDK and got some C code from the <a href="http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html">Department of Computer Science, UNC Chapel Hill</a>.</p>
<p>Setting up the toolkit was bit tricky, but with help from <a href="http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Getting_Started">this page</a> I finally succeeded to get my environment right (OSX). Then I hit &#8216;make&#8217; and presto! Got my swc! <a href="http://www.assembla.com/spaces/floorplanner-alchemy/documents">Download the swc and sample code</a> or <a href="http://www.assembla.com/spaces/floorplanner-alchemy/documents/agZ5W8Uxir3y-mab7jnrAJ/download/TriangulationTest.swf">view a live example</a>.</p>
<p>Some notes on swc usage:<br />
1] &#8216;outer&#8217; polygons must be defined anti-clockwise<br />
2] &#8216;inner&#8217; polygons (holes) must be defined clock-wise</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="actionscript3" style="font-family: Monaco,monospace;"><span style="color: #009900;">// import</span>
<span style="color: #0033ff; font-weight: bold;">import</span> cmodule.triangulation.CLibInit;
&nbsp;
<span style="color: #009900;">// initialize</span>
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000000; font-weight: bold;">:</span>CLibInit = <span style="color: #0033ff; font-weight: bold;">new</span> CLibInit;
<span style="color: #6699cc; font-weight: bold;">var</span> lib<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span> = <span style="color: #004993;">loader</span>.<span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// @vertices is an array of XY-pairs: [ [], [x0, y0], [x1, y1], ...]</span>
<span style="color: #009900;">//                NOTE: @vertices[0] should always be [] </span>
<span style="color: #009900;">// @contours is an array containing the number of points of each polygon</span>
<span style="color: #009900;">//                =&gt; [4, 3, 3, 3] indicates 4 polygons with the first poly having 4 points, the second 3, etc.</span>
<span style="color: #009900;">// @ncontours is the number of polygons (in our example: 4)</span>
<span style="color: #009900;">//</span>
<span style="color: #009900;">// @return An array of indices into the vertices array in form: [ [p0, p1, p2], [p0, p1, p2], ...]</span>
<span style="color: #6699cc; font-weight: bold;">var</span> indices <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Array</span> = lib.triangulate<span style="color: #000000;">&#40;</span> vertices, contours, ncontours <span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>Here&#8217;s the relevant C code which was simply added to tri.c :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
</pre></td><td class="code"><pre class="c" style="font-family: Monaco,monospace;"><span style="color: #993333;">static</span> AS3_Val triangulate<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #339933;">*</span> self<span style="color: #339933;">,</span> AS3_Val args<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> ncontours <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> ccount<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> npoints<span style="color: #339933;">,</span> first<span style="color: #339933;">,</span> last<span style="color: #339933;">,</span> n<span style="color: #339933;">,</span> nmonpoly<span style="color: #339933;">;</span>
	<span style="color: #993333;">register</span> <span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> op<span style="color: #009900;">&#91;</span>SEGSIZE<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> ntriangles<span style="color: #339933;">;</span>
	AS3_Val dataVal<span style="color: #339933;">;</span>
	AS3_Val contourVal<span style="color: #339933;">;</span>
	AS3_Val retVal<span style="color: #339933;">;</span>
	AS3_Val temp<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* initialze the AS3 values */</span>
	dataVal <span style="color: #339933;">=</span> AS3_Undefined<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	contourVal <span style="color: #339933;">=</span> AS3_Undefined<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	retVal <span style="color: #339933;">=</span> AS3_Undefined<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	temp <span style="color: #339933;">=</span> AS3_Undefined<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//parse the arguments.</span>
	AS3_ArrayValue<span style="color: #009900;">&#40;</span> args<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;AS3ValType, AS3ValType, IntType&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>dataVal<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>contourVal<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>ncontours <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//if no argument is specified</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>dataVal <span style="color: #339933;">==</span> NULL <span style="color: #339933;">||</span> contourVal <span style="color: #339933;">==</span> NULL <span style="color: #339933;">||</span> ncontours <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		AS3_Trace<span style="color: #009900;">&#40;</span> AS3_String<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Invalid input data!&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> AS3_Null<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	ccount <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	i <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>ccount <span style="color: #339933;">&lt;</span> ncontours<span style="color: #009900;">&#41;</span>
   	<span style="color: #009900;">&#123;</span>
		<span style="color: #993333;">int</span> j<span style="color: #339933;">;</span>
		<span style="color: #993333;">int</span> k<span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//fscanf(infile, &quot;%d&quot;, &amp;npoints);</span>
&nbsp;
		npoints <span style="color: #339933;">=</span> AS3_IntValue<span style="color: #009900;">&#40;</span> AS3_Get<span style="color: #009900;">&#40;</span>contourVal<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span>ccount<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		first <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
		last <span style="color: #339933;">=</span> first <span style="color: #339933;">+</span> npoints <span style="color: #339933;">-</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>j <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> k <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> npoints<span style="color: #339933;">;</span> j<span style="color: #339933;">++,</span> i<span style="color: #339933;">++,</span> k <span style="color: #339933;">+=</span> <span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">//fscanf(infile, &quot;%lf%lf&quot;, &amp;seg[i].v0.x, &amp;seg[i].v0.y);</span>
			temp <span style="color: #339933;">=</span> AS3_Get<span style="color: #009900;">&#40;</span>dataVal<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span>.<span style="color: #202020;">x</span> <span style="color: #339933;">=</span> AS3_NumberValue<span style="color: #009900;">&#40;</span> AS3_Get<span style="color: #009900;">&#40;</span>temp<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span>.<span style="color: #202020;">y</span> <span style="color: #339933;">=</span> AS3_NumberValue<span style="color: #009900;">&#40;</span> AS3_Get<span style="color: #009900;">&#40;</span>temp<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">==</span> last<span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">next</span> <span style="color: #339933;">=</span> first<span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">prev</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v1</span> <span style="color: #339933;">=</span> seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">==</span> first<span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">next</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">prev</span> <span style="color: #339933;">=</span> last<span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>last<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v1</span> <span style="color: #339933;">=</span> seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">else</span>
			<span style="color: #009900;">&#123;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">prev</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">next</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v1</span> <span style="color: #339933;">=</span> seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">is_inserted</span> <span style="color: #339933;">=</span> FALSE<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		ccount<span style="color: #339933;">++;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	n <span style="color: #339933;">=</span> i <span style="color: #339933;">-</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	initialise<span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	construct_trapezoids<span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	nmonpoly <span style="color: #339933;">=</span> monotonate_trapezoids<span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	ntriangles <span style="color: #339933;">=</span> triangulate_monotone_polygons<span style="color: #009900;">&#40;</span>n<span style="color: #339933;">,</span> nmonpoly<span style="color: #339933;">,</span> op<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	retVal <span style="color: #339933;">=</span> AS3_Array<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;AS3ValType&quot;</span><span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> ntriangles<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
   	<span style="color: #009900;">&#123;</span>
		AS3_Val data <span style="color: #339933;">=</span> AS3_Array<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;IntType, IntType, IntType&quot;</span><span style="color: #339933;">,</span> op<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> op<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> op<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		AS3_Set<span style="color: #009900;">&#40;</span>retVal<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> retVal<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//entry point for code</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//define the methods exposed to ActionScript</span>
	<span style="color: #666666; font-style: italic;">//typed as an ActionScript Function instance</span>
	AS3_Val echoMethod <span style="color: #339933;">=</span> AS3_Function<span style="color: #009900;">&#40;</span> NULL<span style="color: #339933;">,</span> echo <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	AS3_Val triMethod <span style="color: #339933;">=</span> AS3_Function<span style="color: #009900;">&#40;</span> NULL<span style="color: #339933;">,</span> triangulate <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// construct an object that holds references to the functions</span>
	AS3_Val result <span style="color: #339933;">=</span> AS3_Object<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;echo: AS3ValType&quot;</span><span style="color: #339933;">,</span> echoMethod <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	AS3_SetS<span style="color: #009900;">&#40;</span>result<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;triangulate&quot;</span><span style="color: #339933;">,</span> triMethod<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Release</span>
	AS3_Release<span style="color: #009900;">&#40;</span> echoMethod <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	AS3_Release<span style="color: #009900;">&#40;</span> triMethod <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// notify that we initialized -- THIS DOES NOT RETURN!</span>
	AS3_LibInit<span style="color: #009900;">&#40;</span> result <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// should never get here!</span>
	<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2008/11/23/alchemy-first-looks/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Papervision3D 2.0 : Public Alpha Release</title>
		<link>http://techblog.floorplanner.com/2007/12/05/papervision3d-20-public-alpha-release/</link>
		<comments>http://techblog.floorplanner.com/2007/12/05/papervision3d-20-public-alpha-release/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 02:31:28 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/papervision3d-20-public-alpha-release.html</guid>
		<description><![CDATA[Drumroll!
Papervision3D 2.0 (alpha) was just released! Ralph Hauwert did the bulk of the work, with me standing by as a second brain trying to solve the issues we struggled with last few days. There&#8217;s lots of bugs to be fixed of course, but check out the new stuff:
- viewports
- shaded materials (flat, gouraud, phong, bump [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F12%2F05%2Fpapervision3d-20-public-alpha-release%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F12%2F05%2Fpapervision3d-20-public-alpha-release%2F" height="61" width="51" /></a></div><p>Drumroll!<br />
Papervision3D 2.0 (alpha) was just released! <a href="http://www.unitzeroone.com/blog/">Ralph Hauwert</a> did the bulk of the work, with me standing by as a second brain trying to solve the issues we struggled with last few days. There&#8217;s lots of bugs to be fixed of course, but check out the new stuff:</p>
<p>- viewports<br />
- shaded materials (flat, gouraud, phong, bump etc.)<br />
- frustum culling<br />
- <a href="http://ascollada.org/">ascollada</a> : import Collada files using the <a href="http://ascollada.org/">ASCollada</a> library.<br />
- animation<br />
- more!</p>
<p><a href="http://papervision3d.googlecode.com/svn/trunk/branches/GreatWhite/"><br />
Get the code using SVN.</a></p>
<p>Okay, now i&#8217;ll get some sleep!</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2007/12/05/papervision3d-20-public-alpha-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magic Carpet &#8211; APE</title>
		<link>http://techblog.floorplanner.com/2007/08/21/magic-carpet-ape/</link>
		<comments>http://techblog.floorplanner.com/2007/08/21/magic-carpet-ape/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 19:10:54 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/magic-carpet-ape.html</guid>
		<description><![CDATA[APE (Actionscript Physics Engine) is a free AS3 open source 2D physics engine for use in Flash and Flex, released under the MIT License. APE is written and maintained by Alec Cove.
Manuel Bua created a Magic Carpet using Papervison3D and APE. Best of all: source included!
Check the video Manuel made:


var so_1489456580 = new
SWFObject("http://www.youtube.com/v/HUtjKIuauMk","fm_HUtjKIuauMk_1489456580","410","330","6","","","","","");
so_1489456580.addParam("allowFullScreen", "true");
so_1489456580.write("so_targ_HUtjKIuauMk_1489456580");

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F08%2F21%2Fmagic-carpet-ape%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F08%2F21%2Fmagic-carpet-ape%2F" height="61" width="51" /></a></div><p><a href="http://www.cove.org/ape/">APE</a> (Actionscript Physics Engine) is a free AS3 open source 2D physics engine for use in Flash and Flex, released under the MIT License. <a href="http://www.cove.org/ape/">APE</a> is written and maintained by <a href="http://www.cove.org">Alec Cove</a>.</p>
<p><a href="http://manuel.bit-fire.com/">Manuel Bua</a> created a <a href="http://manuel.bit-fire.com/2007/08/11/carpets-sources/">Magic Carpet</a> using <a href="http://blog.papervision3d.org/">Papervison3D</a> and <a href="http://www.cove.org/ape/">APE</a>. Best of all: source included!</p>
<p>Check the video Manuel made:</p>
<p id="so_targ_HUtjKIuauMk_1489456580">
<p><script type="text/javascript">
var so_1489456580 = new
SWFObject("http://www.youtube.com/v/HUtjKIuauMk","fm_HUtjKIuauMk_1489456580","410","330","6","","","","","");
so_1489456580.addParam("allowFullScreen", "true");
so_1489456580.write("so_targ_HUtjKIuauMk_1489456580");
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2007/08/21/magic-carpet-ape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing ASCOLLADA</title>
		<link>http://techblog.floorplanner.com/2007/08/14/introcuding-ascollada/</link>
		<comments>http://techblog.floorplanner.com/2007/08/14/introcuding-ascollada/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 14:04:31 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/introcuding-ascollada.html</guid>
		<description><![CDATA[I&#8217;m happy to introduce ascollada, a AS3 library for reading Collada files.
The library is geared towards Papervision3D but should work with any 3D-engine like Away3D or Sandy.
The library currently features:

simple models
material loading (watch your paths!)
biped animation

Please note that the library is still in its very early stages and most likely will contain bugs.
So, get the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F08%2F14%2Fintrocuding-ascollada%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F08%2F14%2Fintrocuding-ascollada%2F" height="61" width="51" /></a></div><p>I&#8217;m happy to introduce <a href="http://code.google.com/p/ascollada/">ascollada</a>, a AS3 library for reading <a href="http://www.collada.org/">Collada</a> files.</p>
<p>The library is geared towards <a href="http://blog.papervision3d.org/">Papervision3D</a> but should work with any 3D-engine like <a href="http://www.away3d.com/">Away3D</a> or <a href="http://www.flashsandy.org/blog/">Sandy</a>.</p>
<p>The library currently features:</p>
<ol>
<li>simple models</li>
<li>material loading (watch your paths!)</li>
<li>biped animation</li>
</ol>
<p>Please note that the library is still in its <strong>very</strong> early stages and most likely will contain bugs.</p>
<p>So, get the code and try it out! And&#8230; <a href="http://code.google.com/p/ascollada/issues/list">please report bugs</a>!</p>
<p>You can get the code using SVN:</p>
<blockquote style="color:#0a0a0a"><p>http://ascollada.googlecode.com/svn/trunk/as3/trunk/</p></blockquote>
<p>Papervision3D users can opt to use the ascollada branch of PV3D&#8217;s svn:</p>
<blockquote style="color:#0a0a0a"><p>http://papervision3d.googlecode.com/svn/trunk/branches/ascollada/</p></blockquote>
<p>There are some examples in the examples directory to get you going.</p>
<p><span id="more-56"></span></p>
<p><strong>USAGE:</strong> for Papervision3D</p>
<blockquote style="color:#0a0a0a"><p>
// the DAE object is like papervision3d&#8217;s Collada object&#8230;<br />
import org.papervision3d.objects.DAE;</p>
<p>var dae:DAE = new DAE( &#8220;somedae.dae&#8221; );</p>
<p>dae.addEventListener( Event.COMPLETE, daeCompleteHandler);</p>
<p>scene.addChild( dae );
</p></blockquote>
<p>You can also pass a MaterialsList to the DAE constructor to override materials defined within the file:</p>
<blockquote style="color:#0a0a0a"><p>var materials:MaterialsList = new MaterialsList();</p>
<p>// create a simple wireframe material<br />
var material:MaterialObject3D = new WireFrameMaterial();</p>
<p>// add to the list, use the materialname as specified<br />
// in the Collada file.<br />
materials.addMaterial( material, &#8220;Default&#8221; );</p>
<p>var dae:DAE = new DAE( &#8220;somedae.dae&#8221;, materials );</p>
<p>scene.addChild( dae );</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2007/08/14/introcuding-ascollada/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Export CAD to Flash: CAD2FLASH</title>
		<link>http://techblog.floorplanner.com/2005/04/03/cad2flash/</link>
		<comments>http://techblog.floorplanner.com/2005/04/03/cad2flash/#comments</comments>
		<pubDate>Sun, 03 Apr 2005 20:16:52 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/?p=34</guid>
		<description><![CDATA[Over time we have developed our own technique to convert 2D CADdrawings (DWG &#038; DXF) to SVG and Flash (SWF).  Flash is vectorbased just like CAD and can be used for easy webviewing of all sorts of technical drawings.
Check out an online demo of the Suite75 conversion webservice. 
Click on the Select DWG button [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2005%2F04%2F03%2Fcad2flash%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2005%2F04%2F03%2Fcad2flash%2F" height="61" width="51" /></a></div><p>Over time we have developed our own technique to convert 2D CADdrawings (DWG &#038; DXF) to SVG and Flash (SWF).  Flash is vectorbased just like CAD and can be used for easy webviewing of all sorts of technical drawings.</p>
<p>Check out an <a href="http://www.suite75.net/php/flash/cad2flash/"><b>online demo</b></a> of the Suite75 conversion webservice. </p>
<p>Click on the Select DWG button to convert a CADfile from your computer (if you don&#8217;t have a drawing available <a href="http://www.suite75.net/Lab/CADsamples/house2.dwg"><b>download</b></a> this sampleDWG)<br />
After you have selected the file, it will be uploaded to the server for a realtime conversion and the results are sent back to the browser so you can see the CADfile in a flash interface. <br />
or see a sample of a converted drawing : <a href="http://www.suite75.net/lab/sample2.swf"><b>SWF</b></a> or <a href="http://www.suite75.net/lab/sample2.svgz"><b>SVG</b></a></p>
<p>This conversiontool has the following features</p>
<p>- Preserving linewidhts and styles<br />
- Maintains layerinformation<br />
- Skinnable by using seperate interface files</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2005/04/03/cad2flash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CADviewer for Groove</title>
		<link>http://techblog.floorplanner.com/2004/04/30/cadviewer-for-groove/</link>
		<comments>http://techblog.floorplanner.com/2004/04/30/cadviewer-for-groove/#comments</comments>
		<pubDate>Fri, 30 Apr 2004 20:41:11 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Collaboration]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/?p=38</guid>
		<description><![CDATA[The Suite75 CADviewer is an useful tool for all Groove users who work with CAD-files. The tool lets you review 2D CAD-drawings alone or realtime with other space members.

When &#8220;navigate together&#8221; is on, a space-member will see the same drawing as you. When a member zooms or pans the drawing, all other joined members will [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2004%2F04%2F30%2Fcadviewer-for-groove%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2004%2F04%2F30%2Fcadviewer-for-groove%2F" height="61" width="51" /></a></div><p><img height=116 src="http://www.suite75.net/blog/mt/assets/cadviewsmall.jpg" width=150 align=right border=0>The Suite75 CADviewer is an useful tool for all Groove users who work with CAD-files. The tool lets you review 2D CAD-drawings alone or realtime with other space members.</p>
<p><a name="more"></a></p>
<p>When &#8220;navigate together&#8221; is on, a space-member will see the same drawing as you. When a member zooms or pans the drawing, all other joined members will zoom/pan along in real-time. Collaborative viewing is fast because Groove stores all files locally.<br />
Existing layers can be switched on and off and Xref drawings are supported.</p>
<p>The tool works together with the Groove filestool. It scans all the filestools in that particular Groovespace for compatible visiofiles  and displays them in a treeview in the Visioviewertool. By clicking on the files in the treeview you can display the files. By clicking on the navigate together in the tool you have realtime collaborative capabilities for multiple members in the space.</p>
<p>The CADViewer is based on the Suite75 Shared Viewing Framework and offers real-time shared viewing of DWG/DXF files within a Groove Shared Space. This Framework is designed for a variety of viewers to be used within Groove. Any viewer based on this framework will have functionality like: </p>
<p>-Fast and secure standalone or realtime shared file-viewing <br />
-Auto discovery of all viewable files within a Groove Shared Space. <br />
-Save comments to a Discussion Tool <br />
-Print the current view to any printer</p>
<p>The CADViewer was a free tool for Groove 2.5 , promoting the use of Groove within a design process and showcasing the possibilities of solutions provided by Suite75 for the building industry. </p>
<p>UPDATE :The development of the CADviewer tool has stopped and the tool will NOT be updated in the future</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2004/04/30/cadviewer-for-groove/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash to PDF,SWG or X3D</title>
		<link>http://techblog.floorplanner.com/2003/08/18/flash-to-pdfswg-or-x3d/</link>
		<comments>http://techblog.floorplanner.com/2003/08/18/flash-to-pdfswg-or-x3d/#comments</comments>
		<pubDate>Mon, 18 Aug 2003 20:18:01 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/?p=35</guid>
		<description><![CDATA[An example of how to use a Flash interface to collect all sorts of userdata, store it in XML and export this data directly to formats like PDF, SVG and VRML. 
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2003%2F08%2F18%2Fflash-to-pdfswg-or-x3d%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2003%2F08%2F18%2Fflash-to-pdfswg-or-x3d%2F" height="61" width="51" /></a></div><p><img height=116 src="http://www.suite75.net/blog/mt/assets/flash2vrml.jpg" width=150 align=right border=0>An example of how to use a Flash interface to collect all sorts of userdata, store it in XML and export this data directly to formats like PDF, SVG and VRML. </p>
<p><a href="http://www.suite75.net/php/flash/meshTim/"Check out the demo</a></p>
<p>How to use the demo: <br />
If correctly you should see a colorful 2D grid on your left side. Below the grid you can choose which output you will see on the right side of the screen. You can choose between SVG (XML driven graphics), VRML/X3D (3D) or PDF (Adobe Acrobat)<br />
When you drag the points of the Grid any changes will be instantly displayed in the plugin window on the right side. </p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2003/08/18/flash-to-pdfswg-or-x3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Realtime 3D collaboration</title>
		<link>http://techblog.floorplanner.com/2002/05/14/realtime-3d-collaboration/</link>
		<comments>http://techblog.floorplanner.com/2002/05/14/realtime-3d-collaboration/#comments</comments>
		<pubDate>Tue, 14 May 2002 20:47:54 +0000</pubDate>
		<dc:creator>Jeroen</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Collaboration]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/?p=39</guid>
		<description><![CDATA[The Architect0r tool for Groove is a simple 2D/3D design tool. You can draw volumes of different sizes and colours over 5 vertical levels in a 2D interface and can view the results realtime in a 3D viewer giving you instant feedback. 

It is primarily developed to be used in the early stages of a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2002%2F05%2F14%2Frealtime-3d-collaboration%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2002%2F05%2F14%2Frealtime-3d-collaboration%2F" height="61" width="51" /></a></div><p>The Architect0r tool for Groove is a simple 2D/3D design tool. You can draw volumes of different sizes and colours over 5 vertical levels in a 2D interface and can view the results realtime in a 3D viewer giving you instant feedback. </p>
<p><img height=298  vspace=12 src="http://www.suite75.net/blog/mt/suite75/assets/archgroove.jpg" width=425  border=0></p>
<p>It is primarily developed to be used in the early stages of a design process to quickly set up series of layout variants for the design of a building, city plan or an interior design but due to the generic character of the tool it can be used for many different purposes. </p>
<p>Based on Groove, the Architect0r is allowing a group of people to zoom, pan, rotate and even design together in real-time.</p>
<p>Designs can be saved within a Groove space or exported to DXF/DWG format so they can be viewed with the Suite75 CADviewer Tool for Groove or used in almost any CAD software.</p>
<p>The Architect0r was a free tool for Groove 2.0, promoting the use of Groove within a design process and showcasing the possibilities of solutions provided by Suite75 for the building industry. The development of this tool has stopped. There will be NO updates in the future</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2002/05/14/realtime-3d-collaboration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
