Giter Site home page Giter Site logo

tinycg's Introduction

tinyCG-轻量级的计算几何算法库

概述

已经有像CGAL这样鼎鼎大名的几何算法库了,但是我在实际使用中使用的很少。第一个原因是CGAL使用了非常多的C++高级特性,钻研代码是比较困难的;第二个是感觉CGAL还是很重量级的,如果不清楚其中的具体原理,调用起来如果哪里存在问题也是不清楚的;第三个是二三维的图形算法往往需要根据实际的使用场景去定制,才能保证比较好的效率。基于这三个原因,还是准备自己总结一些经常使用的计算几何算法。

CGAL主要是一些类似构建三角网的高端算法,同时还能保证高效率;几何图形之间的拓扑关系,我认为GDAL的OGR组件也非常优秀。我这里主要准备实现一些简单的、常用的二三维计算几何算法,如果有机会,会向前两个库学习。

内容

矢量计算

二维图形算法:

  1. 已知线段上某点与起点的距离,求该点的坐标

三维图形算法:

  1. 空间点与直线距离算法

平面矩形:

  1. 矩形相交

空间三角形:

  1. 已知三点求平面法向量
  2. 已知空间三点组成的面求该面上某点的Z值
  3. 平面中判断点在三角形内算法(同向法)
  4. 空间中判断点在三角形内算法(方程法)
  5. 平面中判断点在三角形内算法(重心法)

tinycg's People

Contributors

fafa1899 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.