怎样将Arranged_2压入General_Polygon_set_2中
Thursday, March 14, 2013
How to Jam an Arrangement_2 into a General_polygon_set_2
昨天我花了近3个小时追踪一个怪异的CGAL的bug——我写那个程序是为了从arrangement中构建出多边形的集合,然后导出这些多边形,而奇怪的多边形
To my annoyance, I discovered today as I went to write the bug up that I knew about this bug...over three
years ago. :-( I get annoyed when I search for the answer to an obscure OpenGL problem and find my own post (e.g. I'm not going to find anything I didn't already know), but it's even more annoying to waste hours on the bug and then have that happen.
让我气愤只是的是,我今天去记录这个问题是发现我事实上在三年前就遇到过了。:-(当我搜索明显的OpengGL问题然后发现了自己的博文(我不会找到不论什么我不知道的)。可是更令人火大的是我居然花了数小时调代码并产生这个错误。
Basically if you are going to build a general polygon set by providing a pre-built arrangement, there are two things you must do:
- Remove redundant edges - the GPS code assumes that the arrangement doesn't have needless edges (which will screw up traversal). Fortunately, the GPS code has a utility to do this, which I just call.
- Then you have to ensure that the direction of the underlying curves along the various edges are consistent - that is, for a given counter-clockwise boundary, every underlying curve goes either with or against the edge.
(After redundant edge removal, the arrangement will contain no antennas, so it will always be possible to get consistency on both sides of a CCB.)
基本上,假设你要从一个预先构建的arrangement中拿出通用多边形集合。有两件事必须做:
With this, polygon set operations work on arbitrary map input.
Why Did You Try This?
It also requires your arrangement to have the containment flag on the face data mixed in. Why go to the trouble? I did this for two reasons:
- Sometimes the polygonal set data I want to process came from an arrangement, and that arrangement is fairly huge. Having to construct the arrangement out of polygons the normal way requires geometry tests - topology data would be lost and rediscovered.
For big maps this is really performance-painful. - I have some operations that work on arrangements that are precursors to boolean sets. For example, the airport surface area data are fundamentally polygon sets (e.g. in the set is the airport surface area) but some of the constructive processing (e.g. simplifying
the contour) run on arrangements.
When an arrangement is turned into a polygon set, one of the results is a rather drastic map cleaning. Since the polygon set cares only about containment (what points are in, what are out), random features like roads tend to get blown away.
PM
怎样将Arranged_2压入General_Polygon_set_2中的更多相关文章
- 面试 16:栈的压入压出队列(剑指 Offer 第 22 题)
我们今天继续来看看周五留下的习题: 面试题:输入两个整数序列,第一个序列表示栈的压入顺序,请判断二个序列是否为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如:压入序列为{1,2,3,4,5},那{ ...
- 剑指offer(21)栈的压入、弹出序列
题目描述 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序 ...
- 《剑指offer》-栈的压入、弹出序列
输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序列对应的一 ...
- 剑指offer-第四章解决面试题的思路(栈的压入和弹出序列)
题目:输入两个整数序列,第一个序列表示栈的压入序列,请判断第二个序列是否为弹出序列. 思路:定义两个指针sPush和sPop分别指向两个整数序列的开头,借助一个辅助的栈,将第一个序列的数据依次压入栈中 ...
- 【剑指Offer】21、栈的压入、弹出序列
题目描述: 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2 ...
- 剑指Offer-21.栈的压入、弹出序列(C++/Java)
题目: 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈 ...
- 剑指offer31----栈的压入、弹出序列
题目:输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序列对 ...
- 剑指Offer面试题:20.栈的压入、弹出序列
一.题目:栈的压入.弹出序列 题目:输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1.2.3.4.5是某栈的压栈序列,序列4 ...
- 剑指Offer:面试题22——栈的压入,弹出序列(java实现)
题目描述: 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈 ...
随机推荐
- 递归删除子目录下所有.la后缀文件
删除当前目录及其子目录下的后缀名.la的所有文件 find ./ -name '*.la' | xargs rm -f
- flume中Source
Spooling Directory Source: 以下2组参数解释: fileHeader及fileHeaderKey:fileHeader是个布尔值,可配置为true或者false,表示在flu ...
- hdu4675 GCD of Sequence 莫比乌斯+组合数学
/** 题目:hdu4675 GCD of Sequence 链接:http://acm.hdu.edu.cn/showproblem.php?pid=4675 题意:给定n个数的a数组,以及m,k: ...
- 查看cpu 个数, 内存信息
查看物理CPU个数 cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l 查看每个物理CPU中core的个数(即核数) ...
- $ -----JavaScript 中美元符号 $ 的作用
JavaScript 中美元符号 $ 是什么 1.首先可以用来表示变量,比如变量 var s='asdsd'或var $s='asdasd'; 2.在正则表达式中,它可以匹配结尾:/sa$/.test ...
- 【BZOJ】1004: [HNOI2008]Cards(置换群+polya+burnside)
http://www.lydsy.com/JudgeOnline/problem.php?id=1004 学习了下polya计数和burnside引理,最好的资料就是:<Pólya 计数法的应用 ...
- 转载:Python十分钟入门
Python十分钟入门:http://python.jobbole.com/23425/
- 关于Java中的HashMap的深浅拷贝的测试与几点思考
0.前言 工作忙起来后,许久不看算法,竟然DFA敏感词算法都要看好一阵才能理解...真是和三阶魔方还原手法一样,田园将芜,非常可惜啊. 在DFA算法中,第一步是需要理解它的数据结构,在此基础上,涉及到 ...
- Maven项目POM.xml详解
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
- 从 Microsoft Dynamics CRM 4.0 server迁移到 Microsoft Dynamics CRM 2013 Server
不能就地升级早于 Microsoft Dynamics CRM Server 2011 的版本号,比方 Microsoft Dynamics CRM 4.0 server.可是,能够在升级过程中使用 ...