当前位置:网站首页>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;
}
边栏推荐
- 1592 example 1 King (sgu223 loj10170 luogu1896 increase + / provincial election -) violent thinking pressure DP 01 Backpack
- cocoaPods 添加成功后,导入不了头文件或者not found file 报错
- On the next generation entrance of the metauniverse -- the implementation of brain computer interface
- 【蓝桥杯Web】2022年第十三届蓝桥杯Web大学组国赛真题解析
- DS Transunet:用于医学图像分割的双Swin-Transformer U-Net
- Realize pyramids through JS (asterisk pyramid, palindrome symmetric digital pyramid)
- 由浅入深学会白盒测试用例设计
- 漏洞复现-.Net-ueditor上传
- [research materials] national second-hand housing market monthly report January 2022 - Download attached
- Set object value changes null value object
猜你喜欢

Richview trvdocparameters page parameter settings

NSI脚本的测试

Hls4ml reports an error the board_ part definition was not found for tul. com. tw:pynq-z2:part0:1.0.

EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化

如何用OpenMesh创建一个四棱锥

Develop those things: easycvr cluster device management page function display optimization

A quietly rising domestic software, low-key and powerful!

Mo Tianlun salon | Tsinghua qiaojialin: Apache iotdb, originated from Tsinghua, builds an open source ecological road

3D panoramic model display visualization technology demonstration

Bind this of the current scope for callback functions in other cases such as timers and delayers
随机推荐
[research materials] Huawei Technology ICT 2021: at the beginning of the "Yuan" year, the industry is "new" -- download attached
On the usage of a magic function
Stack Overflow 2022 开发者调查:行业走向何方?
Getting started with fastdfs
Oracle 死锁测试
由浅入深学会白盒测试用例设计
实战项目笔记(一)——虚拟机的创建
基于图的 Affinity Propagation 聚类计算公式详解和代码示例
Realize pyramids through JS (asterisk pyramid, palindrome symmetric digital pyramid)
[mysql] install mysql5.7
8K HDR!|为 Chromium 实现 HEVC 硬解 - 原理/实测指南
EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
如何用OpenMesh创建一个四棱锥
寫博客文檔
Keras机器翻译实战
【多线程】锁策略
#yyds干货盘点#SQL聚合查询方法总结
RichView TRVDocParameters 页面参数设置
牛客编程题--必刷101之字符串(高效刷题,举一反三)
Servlet knowledge points