当前位置:网站首页>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;
}
边栏推荐
-
- Redis installation and startup in Windows environment (background startup)
- Install redis under Linux and configure the environment
- 想得到股票开户的优惠链接,如何得知?在线开户是安全么?
- Error in installing sharp
- Flask 常用组件
- A quietly rising domestic software, low-key and powerful!
- 3D panoramic model display visualization technology demonstration
- list大集合等比分割成多个小list集合
- Optimization of the problem that the request flow fails to terminate during page switching of easycvr cluster video Plaza
猜你喜欢

Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?

开发那些事儿:EasyCVR集群设备管理页面功能展示优化
![[research materials] iResearch tide Watching: seven major trends in the clothing industry - Download attached](/img/c8/a205ddc2835c87efa38808cf31f59e.jpg)
[research materials] iResearch tide Watching: seven major trends in the clothing industry - Download attached

GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速

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

1592 example 1 King (sgu223 loj10170 luogu1896 increase + / provincial election -) violent thinking pressure DP 01 Backpack

Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation

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

Procédure de mesure du capteur d'accord vibrant par le module d'acquisition d'accord vibrant

Use Zadig to build a continuous delivery platform from 0 to 1
随机推荐
The large list set is divided into multiple small list sets in equal proportion
Myslq ten kinds of locks, an article will take you to fully analyze
关于一个神奇函数的用法
EasyCVR通过国标GB28181协议接入设备,出现设备自动拉流是什么原因?
【多线程】锁策略
【多线程】 实现单例模式 ( 饿汉、懒汉 ) 实现线程安全的单例模式 (双重效验锁)
Modsim basic use (Modbus simulator)
2022/5/23-2022/5/30
What else do you not know about new set()
Optimization of the problem that the request flow fails to terminate during page switching of easycvr cluster video Plaza
Realize pyramids through JS (asterisk pyramid, palindrome symmetric digital pyramid)
开发那些事儿:EasyCVR平台添加播放地址鉴权功能
Tensorflow reports an error, could not load dynamic library 'libcudnn so. eight
math_利用微分算近似值
DS transunet: Dual Swing transformer u-net for medical image segmentation
SwiftUI 4 新功能大全之 Toggle与 Mixed Toggle 多个绑定组件
C # joint halcon Application - Dahua Camera Collection class
MYSLQ十种锁,一篇文章带你全解析
2022/6/8-2022/6/12
Stack overflow 2022 developer survey: where is the industry going?