当前位置:网站首页>How to create a pyramid with openmesh
How to create a pyramid with openmesh
2022-07-01 20:09:00 【CSU Kaya】
Construct a pyramid out of thin air as shown in the figure , The basic message is [V, E, F] = [5, 9, 6]
The coordinates of each point are A(0,0,1) B(-1,1,0) C(1,1,0) D(1,-1,0) E(-1,-1,0)
Determine the order in which patches are added AED->ACB->ADC->ABE->BDE->DBC
Be careful : The order of adding points of each face should be that the normal vector facing outward relative to the face is counterclockwise
// IoTestPro.cpp : This file contains "main" function . Program execution will start and end here .
//
#include <iostream>
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <OpenMesh/Core/Mesh/TriMesh_ArraykernelT.hh>
#include <OpenMesh/Core/Mesh/PolyConnectivity.hh>
typedef OpenMesh::TriMesh_ArrayKernelT<> TriMesh;
int main()
{
TriMesh mesh;// It is expected to be a pyramid
TriMesh::VertexHandle vhandle[5];// Handle array of points
std::vector<TriMesh::VertexHandle> face_vhandles;// A face contains multiple points
vhandle[0] = mesh.add_vertex(TriMesh::Point(0, 0, 2));// spot A
vhandle[1] = mesh.add_vertex(TriMesh::Point(-1, 1, 0));// spot B
vhandle[2] = mesh.add_vertex(TriMesh::Point(1, 1, 0));// spot C
vhandle[3] = mesh.add_vertex(TriMesh::Point(1, -1, 0));// spot D
vhandle[4] = mesh.add_vertex(TriMesh::Point(-1, -1, 0));// spot E
// Structural plane AED And add mesh
face_vhandles.push_back(vhandle['A' - 65]);
face_vhandles.push_back(vhandle['E' - 65]);
face_vhandles.push_back(vhandle['D' - 65]);
mesh.add_face(face_vhandles);
// Structural plane ACB And add mesh
face_vhandles.clear();
face_vhandles.push_back(vhandle['A' - 65]);
face_vhandles.push_back(vhandle['C' - 65]);
face_vhandles.push_back(vhandle['B' - 65]);
mesh.add_face(face_vhandles);
// Structural plane ADC And add mesh
face_vhandles.clear();
face_vhandles.push_back(vhandle['A' - 65]);
face_vhandles.push_back(vhandle['D' - 65]);
face_vhandles.push_back(vhandle['C' - 65]);
mesh.add_face(face_vhandles);
// Structural plane ABE And add mesh
face_vhandles.clear();
face_vhandles.push_back(vhandle['A' - 65]);
face_vhandles.push_back(vhandle['B' - 65]);
face_vhandles.push_back(vhandle['E' - 65]);
mesh.add_face(face_vhandles);
// Structural plane BDE And add mesh
face_vhandles.clear();
face_vhandles.push_back(vhandle['B' - 65]);
face_vhandles.push_back(vhandle['D' - 65]);
face_vhandles.push_back(vhandle['E' - 65]);
mesh.add_face(face_vhandles);
// Structural plane DBC And add mesh
face_vhandles.clear();
face_vhandles.push_back(vhandle['D' - 65]);
face_vhandles.push_back(vhandle['B' - 65]);
face_vhandles.push_back(vhandle['C' - 65]);
mesh.add_face(face_vhandles);
return 0;
}
边栏推荐
- 【多线程】 实现单例模式 ( 饿汉、懒汉 ) 实现线程安全的单例模式 (双重效验锁)
- Entering Ruxin Town, digital intelligence transformation connects "future community"
- EURA欧瑞E1000系列变频器使用PID实现恒压供水功能的相关参数设置及接线
- Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
- C # joint halcon Application - Dahua Camera Collection class
- 2022/6/8-2022/6/12
- 基于图的 Affinity Propagation 聚类计算公式详解和代码示例
- On the usage of a magic function
- PHP获取微信小程序和小程序商店外链地址
- 大厂做狼,小厂做狗?
猜你喜欢
On the next generation entrance of the metauniverse -- the implementation of brain computer interface
Modsim basic use (Modbus simulator)
Getting started with fastdfs
A quietly rising domestic software, low-key and powerful!
Use Zadig to build a continuous delivery platform from 0 to 1
简单但现代的服务器仪表板Dashdot
[untitled]
开发那些事儿:EasyCVR平台添加播放地址鉴权功能
300题线性代数 第四讲 线性方程组
STC 32位8051单片机开发实例教程 二 I/O工作模式及其配置
随机推荐
Win11快捷键切换输入法无反应怎么办?快捷键切换输入法没有反应
Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?
docker ubuntu容器中安装mysql遇到的问题
开发那些事儿:EasyCVR平台添加播放地址鉴权功能
cocoaPods 添加成功后,导入不了头文件或者not found file 报错
利用QEventLoop实现同步等待槽函数返回
强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
internship:逐渐迈向项目开发
【多线程】锁策略
数据分析师听起来很高大上?了解这几点你再决定是否转型
Use Zadig to build a continuous delivery platform from 0 to 1
Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
list大集合等比分割成多个小list集合
fastDFS入门
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
2022/5/23-2022/5/30
上大学后明白了哪些坑人的事?
Bind this of the current scope for callback functions in other cases such as timers and delayers
RichView 文档中的 ITEM