[Manifold-l] Duplicating the GUI Explode Transform in SQL

Lorne lketch at hfx.eastlink.ca
Tue Jul 4 12:12:03 CDT 2006


Your example is soooooo neat!  Thanks Adam!

Any chance there will be more split functions added in the future?
Something like:
SELECT [ID], [P] FROM [D] SPLIT BY LineSegments([ID]) AS [P] Where
GeomType(ID)= 2;

Lorne


-----Original Message-----
From: manifold-l-bounces at lists.directionsmag.com
[mailto:manifold-l-bounces at lists.directionsmag.com] On Behalf Of
adamw at manifold.net
Sent: July 4, 2006 10:34 AM
To: manifold-l at lists.directionsmag.com
Subject: RE: [Manifold-l] Duplicating the GUI Explode Transform in SQL


> I would like to be able to script an SQL clause that provides the same 
> functionality as GUI Explode.

Given the following auxilary query named "digits":

 VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9)

...this will take the drawing named "Drawing" (single-branch lines only, no
filtering is being done) and explode each line into segments:

 SELECT [ID],
   NewLine(Coord([Geom (I)], N.V), Coord([Geom (I)], N.V + 1))  FROM
[Drawing] INNER JOIN
  (SELECT D1.[Column]*100 + D2.[Column]*10 + D3.[Column]*1 V
   FROM [Digits] D1, [Digits] D2, [Digits] D3) N
 ON N.V < CoordCount([Geom (I)]) - 1

The inner query creates a temporary table filled with numbers from 0 to 999.

--
Adam Wachowski
Manifold Development Team



_______________________________________________
Manifold-l mailing list
Manifold-l at lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/manifold-l


More information about the Manifold-l mailing list