找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 2265|回复: 2

[分享] Computational Geometry, C++ and Wykobi

[复制链接]

已领礼包: 1268个

财富等级: 财源广进

发表于 2014-12-8 14:43:12 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
http://www.codeproject.com/Articles/22568/Computational-Geometry-C-and-WykobiComputational Geometry, C++ and WykobiA brief introduction in computational geometry algorithms using Wykobi and C++
0.jpg
Introduction Good C++ computational geometry libraries to date have been hideously over-designed and incorporate usage patterns that in most cases require extensive redesigns and rewrites of code in order to functionally integrate within an existing project.
Sometimes a lightweight portable solution that has a bit of error is deemed to be more appropriate and reasonable. However these libraries even though being more than able to cater for such a requirement still burden the end user with undue code clutter, very steep learning curves and in some cases unnecessary overheads.
The solution to such a situation is to simplify use, implementation and application. This can be achieved by reducing the number of contact points between the computational geometry back-end and the developer-application combo. But at the same time giving full control of the computations and ensuing folding processes to the user to the extent where the user can decide between using a general solution for a particular problem or a more specialized solution.
For example, say you have two line segments and you want to know if they are intersecting, one could use a general solution, but say if you had prior knowledge that the line segments were either always going to be vertical or horizontal, this would allow one to use a more efficient method to obtain the same result. Typically (but not always) a generalized result is less efficient than a specialised result for the specialised case - by virtue of the fact that the generalised result has to take into account the 1001 other possible scenarios.
A possible solution to the above mentioned problem is Wykobi. Wykobi is an efficient, robust and simple to use multi-platform 2D/3D computational geometry library. Wykobi provides a concise, predictable, and deterministic interface for geometric primitives and complex geometric routines using and conforming to the ISO/IEC 14882:2003 C++ language specification.
The design and structure of Wykobi lends itself to easy and seamless integration into projects of any scale that require a robust yet efficient 2D/3D computational geometry back-end.
Wykobi as a library can be used to efficiently and seamlessly solve complex geometric problems such as collision and proximity detection, efficient spatial queries and geometric constructions used in areas as diverse as gaming, computer aided design and manufacture, electronic design and geographic information systems - just to name a few.
Wykobi provides a series of primitive geometric structures for use within the various algorithms of interest such as intersections, distances, inclusions and clipping operations.

The Wykobi Data StructuresThe Point Type Basic point types, which are zero dimensional entities that exist in either 2D, 3D or n-dimensions.
template<typename T = Float>class point2d : public geometric_entity {};template<typename T = Float>class point3d : public geometric_entity {};template<typename T = Float, std::size_t Dimension>class pointnd : public geometric_entity {};
The Line Type Line type, which is a 1 dimensional entity of infinite length that is described by two points within its present dimension.
1.jpg
template <typename T, unsigned int Dimension>class line : public geometric_entity {};
The Segment (Line-Segment) Type Segment type, similar to the line type, but is of finite length bounded by the two points which describe it within its present dimension.
2.jpg
template <typename T, unsigned int Dimension>class segment : public geometric_entity {};
The Ray Type Ray type, A directed half-infinite line or half-line. A ray has an origin point and a vector that describes the direction in which all the points that are members of the set of points that make up the ray exist upon.
3.jpg
template <typename T, unsigned int Dimension>class ray : public geometric_entity {};
The Triangle Type Triangle type, A geometric primitive that is comprised of 3 unique points, which produce 3 unique edges.
4.jpg
template <typename T, unsigned int Dimension>class triangle : public geometric_entity {};
The Rectangle Type Rectangle type, An axis aligned 4 sided geometric primitive, described by two bounding points in 2D. A rectangle's form in 3D and higher dimensions is a box.
5.jpg
template<typename T>class rectangle : public geometric_entity {};
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 8125个

财富等级: 富甲天下

发表于 2014-12-11 09:47:43 | 显示全部楼层
这本书还可以,不过是英文的,看着有点吃力了。另外,这本书的源代码,我附上了。
请点击此处下载

请先注册会员后在进行下载

已注册会员,请先登录后下载

文件名称:Ccode2.rar 
下载次数:1  文件大小:66.3 KB  售价:5D豆 [记录]
下载权限: 学生 以上  [免费赚D豆]


论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-20 07:42 , Processed in 0.391869 second(s), 35 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表