当前位置:网站首页>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;
}
边栏推荐
- list大集合等比分割成多个小list集合
- 毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
- Face recognition system opencv face detection
- internship:逐渐迈向项目开发
- STC 32位8051单片机开发实例教程 三 程序编译设置与下载
- Richview trvdocparameters page parameter settings
- 简单但现代的服务器仪表板Dashdot
- Problems encountered in installing MySQL in docker Ubuntu container
- 牛客编程题--必刷101之字符串(高效刷题,举一反三)
- 数据分析师听起来很高大上?了解这几点你再决定是否转型
猜你喜欢

EDA工具对芯片产业的重要性知识科普

cocoaPods 添加成功后,导入不了头文件或者not found file 报错

SQL getting started plan-1-select

毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?

Servlet knowledge points

How to turn off the boot auto start software in win11

RichView RichEdit SRichViewEdit PageSize 页面设置与同步

Review the collection container again
![[research materials] national second-hand housing market monthly report January 2022 - Download attached](/img/c8/a205ddc2835c87efa38808cf31f59e.jpg)
[research materials] national second-hand housing market monthly report January 2022 - Download attached

开发那些事儿:EasyCVR集群设备管理页面功能展示优化
随机推荐
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
全国职业院校技能大赛网络安全“splunk“详细配置
On the usage of a magic function
墨天轮沙龙 | 清华乔嘉林:Apache IoTDB,源于清华,建设开源生态之路
Error in installing sharp
[multithreading] lock strategy
牛客编程题--必刷101之字符串(高效刷题,举一反三)
Stack Overflow 2022 开发者调查:行业走向何方?
漏洞复现-.Net-ueditor上传
Using qeventloop to realize synchronous waiting for the return of slot function
How can a programmer grow rapidly
[Blue Bridge Cup web] analysis of the real topic of the 13th Blue Bridge Cup web university group match in 2022
数据分析师听起来很高大上?了解这几点你再决定是否转型
EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
实战项目笔记(一)——虚拟机的创建
C#联合halcon应用——大华相机采集类
ORA-01950
Iframe 父子页面通信
internship:逐渐迈向项目开发
关于new Set( )还有哪些是你不知道的