[X3D-Public] 2D footprint with holes in X3D

doug sanden highaspirations at hotmail.com
Thu Dec 18 08:57:03 PST 2014


Solution #5 Rasterization
Steps: 
1. split up your city area into mapsheet rectangles, decide on a pixel size
2. for each mapsheet 
a) set up transform from polygon coordinates to mapsheet image coordinates
b) use brezenhams algorithm to convert polygon line segments into pixel hits on mapsheet
c) load each raster mapsheet into an image program and manually floodfill
-Doug
http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

________________________________
> Date: Wed, 17 Dec 2014 16:50:04 +0100 
> Subject: RE : Re: [X3D-Public] 2D footprint with holes in X3D 
> From: eric at geovrml.com 
> To: highaspirations at hotmail.com 
> CC: x3d-public at web3d.org 
>  
> Usually in GIS, this kind of problem is managed by digitisation order:  
> ccw for the outer shell of your footprint and cw for inner holes.  
> Recursively, for each contained polygon/hole the digitisation direction  
> changes. 
> Recursive constrained Delaunay triangulation is then the answer,  
> digitisation direction gives you the hint for identifying holes and  
> polygons on the go. 
> Eric. 
>  
>  
> Envoyé depuis un mobile Samsung 
>  
>  
>  
> -------- Message d'origine -------- 
> De : doug sanden <highaspirations at hotmail.com> 
> Date : 
> A : 
> Cc : x3d-public at web3d.org 
> Objet : Re: [X3D-Public] 2D footprint with holes in X3D 
>  
>  
> assuming you have polygons defined for the outer block rectangles and  
> inner holes, but no connection between them / nothing to say which is  
> which, except the hole polygons would be located inside the block  
> polygons 
> Solution #2 
> translate each block and its holes into a single character glyph in a  
> font file. Then position and draw each block as a Text node with one  
> character. 
> Thinking: font characters can have holes, as in O P B 9 Q 0 8, and are 2D. 
> -Doug 
> more.. 
> I wonder if there could be a 2D geometry node for something like this.  
> In some web3d browsers, the font glyphs get converted to triangles, and  
> that process doesn't know a priori which glyph polygons are inside  
> holes or outside outlines. That process could be extracted into a 2D  
> node that takes a series of polygons, and renders as faces with holes. 
>  
> Solution #3 
> batch process your polygons to generated IndexFaceSet or TriangleSet2D: 
> 1. intersect each polygon with all other polygons, and insert the  
> intersection points into each affected polygon 
> 2. delaunay triangulate all the points of all the polygons in one batch 
> 3. follow each polygon in the triangles, swapping quad bisectors to  
> align with the polygon as you go (un-delaunay) 
> 4. do point-in-polygon test for each triangle (its center of gravity)  
> using the plumbline algorithm against all the polygons and delete the  
> triangle if its plumblne intersects polygon segments an even number of  
> times: 0, 2, 4 .. 
>  
>  
>  
> ________________________________ 
> > Date: Tue, 16 Dec 2014 07:23:42 -0800 
> > From: web3d at realism.com 
> > To: cris.lacumba at gmail.com 
> > CC: x3d-public at web3d.org 
> > Subject: Re: [X3D-Public] 2D footprint with holes in X3D 
> > 
> > Cris, 
> > 
> > There is an Open Geospatial Consortium (OGC) working on a definition 
> > for work with cities and buildings called CityGML 
> > (http://www.opengeospatial.org/standards/citygml). The Web3D Consortium 
> > has a liaison relationship with them. They may have worked on a lot of 
> > what you are trying to do. There are other groups within OGC that may 
> > also provide useful information. The Web3D Consortium is sponsoring a 
> > city modeling competition. The details are at 
> > http://www.web3d.org/competition/city-modeling-2015. 
> > 
> > X3DOM V1.3 started to include 2D geometry nodes. I do not know their 
> > current state. The current node list is at 
> > http://doc.x3dom.org/author/nodes.html. See 
> > http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter10-Geometry2D/ 
> > for examples in X3D of all of the 2D nodes see 
> > http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter10-Geometry2D/. 
> > 
> > 
> > Leonard Daly 
> > Co-Chair, X3D WG 
> > 
> > 
> > Hello again, 
> > 
> > The idea is to present an entire city in 2D with X3D, so I can't do a 
> > manual work with Blender because is not feasible. 
> > The solution of adding extra sides as Vincent said it can be easier to 
> > develop but is not easy. 
> > 
> > I only need the footprint to visualize. Textures are not going to be 
> > used for now. 2D geometries are supported in X3DOM? Beucase I have to 
> > visualize the obtained X3D using X3DOM. 
> > 
> > Thanks again! 
> > 
> > Best regards 
> > 
> > 2014-12-15 16:19 GMT+01:00 Leonard Daly 
> > <web3d at realism.com<mailto:web3d at realism.com>>: 
> > Cris Lacumba, 
> > 
> > There are a lot of ways to construct a polygonal representation of a 
> > shape. The way you choose depends on what you are going to do with the 
> > shape, how it needs to be textured, and the tools you have available 
> > for your development. For IndexedFaceSet all of the polygons must be 
> > convex (no "L" shaped ones). Most graphic systems will convert the IFS 
> > to triangles, so if you want detailed control, you might want to create 
> > your own triangles. This can be particularly important if any polygon 
> > is a saddle point. Which way do you triangulate - top-left to 
> > bottom-right or top-right to bottom-left. 
> > 
> > 
> >     -1          +1 
> >        +-------+ 
> >        |       | 
> >        |       | 
> >        +-------+ 
> >      +1        -1 
> > 
> > 
> > You may also wish to look into the 2D shapes (see 
> > http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter10-Geometry2D/). 
> > 
> > Vince and Doug have offered two solutions. If neither of these works 
> > for you, please tell us more how the footprint will be used and the 
> > tools you have available, other specific solutions can be offered. 
> > 
> > 
> > Leonard Daly 
> > 
> > 
> > 
> > Hello to all, 
> > 
> > I'm trying to represent the 2D footprint of a building.However, some of 
> > them have patios or holes inside the footprint. (see the attachment) 
> > How can I represent that using IndexedFaceSet? 
> > 
> > Thanks in advance 
> > 
> > Best regards 
> > 
> > Cris 
> > 
> > 
> > 
> > _______________________________________________ 
> > X3D-Public mailing list 
> > X3D-Public at web3d.org<mailto:X3D-Public at web3d.org> 
> > http://web3d.org/mailman/listinfo/x3d-public_web3d.org 
> > 
> > 
> > 
> > -- 
> > Leonard Daly 
> > X3D Co-Chair 
> > Cloud Consultant 
> > President, Daly Realism - Creating the Future 
> > 
> > _______________________________________________ 
> > X3D-Public mailing list 
> > X3D-Public at web3d.org<mailto:X3D-Public at web3d.org> 
> > http://web3d.org/mailman/listinfo/x3d-public_web3d.org 
> > 
> > 
> > 
> > -- 
> > Leonard Daly 
> > X3D Co-Chair 
> > Cloud Consultant 
> > President, Daly Realism - Creating the Future 
> > 
> > _______________________________________________ X3D-Public mailing list 
> > X3D-Public at web3d.org 
> > http://web3d.org/mailman/listinfo/x3d-public_web3d.org 
>  
> _______________________________________________ 
> X3D-Public mailing list 
> X3D-Public at web3d.org 
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org 
 		 	   		  


More information about the X3D-Public mailing list