帮酷LOGO
  • 显示原文与译文双语对照的内容
文章标签: 三角法  DEL  Polygon  三角剖分  凸多边形  Convex  
Delaunay triangulation for convex polygon

  • 源代码名称:delaunay
  • 源代码网址:http://www.github.com/Yonaba/delaunay
  • delaunay源代码文档
  • delaunay源代码下载
  • Git URL:
    git://www.github.com/Yonaba/delaunay.git
  • Git Clone代码到本地:
    git clone http://www.github.com/Yonaba/delaunay
  • Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/Yonaba/delaunay
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
  • Delaunay

    Build StatusCoverage StatusLicense

    delaunay 是一个凸多边形三角剖分的Lua模。

    ##Download

    ###Git

    git clone http://github.com/Yonaba/delaunay.git

    ###Archive

    ###LuaRocks

    luarocks install delaunay

    ###MoonRocks

    luarocks install --server=http://rocks.moonscript.org/manifests/Yonaba delaunay

    在项目文件夹中复制文件 delaunay.lua,用调用它需要的函数。 它将返回 Delaunay 模块,确保全局环境安全。

    ##Usage

    模块提供了 3个类:

    • Point
    • Edge
    • Triangle

    它还提供一个名为 triangulate的函数。 这里函数接受类 Point 实例的变量列表( vararg )。 这些点是凸多边形的顶点,它将返回一个表,其中包含一个类 Triangle,该表生成了给定多边形的一个三。

    一个基本的代码示例:

    local Delaunay =require'Delaunay'local Point = Delaunay.Point-- Creating 10 random pointslocal points = {}for i =1, 10do points[i] =Point(math.random() *100, math.random() *100)end-- Triangulating de convex polygon made by those pointslocal triangles = Delaunay.triangulate(unpack(points))-- Printing the resultsfor i, triangle inipairs(triangles) doprint(triangle)end

    有关详细信息,请参阅文档

    ##Testing ###Specification

    这里知识库包括单元测试。 你可以使用望远镜从 root foolder运行以下命令:

    lua tsc -f specs/*

    ###Performance

    可以从 root 文件夹中运行包含在以下命令中的随机性能测试:

    lua performance/bench.lua

    ##License 这项工作是在许可协议
    版权所有( c ) 2013罗兰 Yonaba

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the
    "Software"), to deal in the Software without restriction, including
    without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:
    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.
    THE SOFTWARE IS PROVIDED"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Bitdeli Badge



    文章标签:DEL  Polygon  Convex   三角法  三角剖分  凸多边形  

    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语