当前位置: 首页 > news >正文

CGAL::2D Arrangements-4

4. Free函数

Arrangement_on_surface_2类模板是用曲线切分二维的面。因为它的接口设计是最简化的,这意味着它的成员函数很少执行几何操作。本章将解释怎么利用这些Free function来达到Arrangement操作。执行这些操作通常需要优秀的几何算法,而且有时会对几何traits类增加额外的要求。这些操作很多都是基于2个框架:面扫描(surface sweep)和区域构建(zone contructions)。这些操作接收一个x单调的曲线,因此几何特征类(geometry-traits class)可以被Arrangement当入参和出参,这些操作必须是ArrangementXMonotoneTraits_2概念的一个model。

4.1 区域构建算法
4.1.1 插入一对不相交的曲线
4.1.2 插入X单调的曲线
4.1.3 插入一般曲线
4.1.4 插入点集
4.1.5 插入相交的线段(code example)

文件在Arrangement_on_surface_2/incremental_insertion.cpp

代码段如下:

// Using the global incremental insertion functions.
#include <CGAL/basic.h>
#include <CGAL/Arr_naive_point_location.h>
#include "arr_exact_construction_segments.h"
#include "arr_print.h"
typedef CGAL::Arr_naive_point_location<Arrangement>             Naive_pl;
typedef CGAL::Arr_point_location_result<Arrangement>::Type      Pl_result_type;
int main() {// Construct the arrangement of five intersecting segments.Arrangement arr;Naive_pl pl(arr);Segment s1(Point(1, 0), Point(2, 4));Segment s2(Point(5, 0), Point(5, 5));Segment s3(Point(1, 0), Point(5, 3));Segment s4(Point(0, 2), Point(6, 0));Segment s5(Point(3, 0), Point(5, 5));auto e = insert_non_intersecting_curve(arr, s1, pl);insert_non_intersecting_curve(arr, s2, pl);insert(arr, s3, Pl_result_type(e->source()));insert(arr, s4, pl);insert(arr, s5, pl);print_arrangement_size(arr);// Perform a point-location query on the resulting arrangement and print// the boundary of the face that contains it.Point q(4, 1);auto obj = pl.locate(q);auto* f = boost::get<Arrangement::Face_const_handle>(&obj);std::cout << "The query point (" << q << ") is located in: ";print_face<Arrangement>(*f);return 0;
}
4.2 另外的区域关联函数
4.3 面扫描算法
4.4 删除点和边
4.5 垂直分解

http://www.lryc.cn/news/296318.html

相关文章:

  • 终端命令提示符:如何查看我们电脑端口是否被占用和处理方式
  • elasticsearch重置密码操作
  • 从零开始手写mmo游戏从框架到爆炸(零)—— 导航
  • 机器学习7-K-近邻算法(K-NN)
  • 相机图像质量研究(7)常见问题总结:光学结构对成像的影响--镜片固化
  • 猫头虎分享已解决Bug || Go Error: cannot convert int to string
  • 前端bug手册
  • Elasticsearch中Document Routing特性
  • 【Git版本控制 03】远程操作
  • 【Git】Windows下通过Docker安装GitLab
  • flutter 操作mysql
  • c++阶梯之类与对象(中)< 续集 >
  • GitLag所有操作-汇总
  • JSch - 配置SFTP服务器SSH免密登录
  • RISC-V指令格式
  • Linux 文件比较工具
  • 【GAMES101】Lecture 17 材质
  • 数模.matlab画图
  • [word] word表格表头怎么取消重复出现? #媒体#笔记#职场发展
  • vue项目开发vscode配置
  • BUUCTF-Real-[Tomcat]CVE-2017-12615
  • Qt应用软件【协议篇】http协议get、post示例
  • 如何选择Centos的替代者
  • 【Java数据结构】ArrayList和LinkedList的遍历
  • springboot163美食推荐商城的设计与实现
  • [机器学习]K-means——聚类算法
  • 并发编程 java锁机制
  • Onerugged三防平板厂家丨三年质保承诺丨三防平板PAD
  • Android 系统启动流程
  • 鸿蒙学习-app.json5配置文件