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

扁平化 wordpress 主题权威seo技术

扁平化 wordpress 主题,权威seo技术,重庆建设工程监管平台,毕业生对于网站建设感受A-9 2025/5/26 OpenCasCade读取STEP文件中的NURBS曲面 OpenCasCade读取NURBS曲面并输出NURBS曲面的所有信息,包括控制点,节点向量,权重等等。也输出NURBS曲面的离散化边界轮廓线。也就是线段连接而成的轮廓线,线段的顺序有待商榷…

A-9 2025/5/26

OpenCasCade读取STEP文件中的NURBS曲面

  • OpenCasCade读取NURBS曲面并输出NURBS曲面的所有信息,包括控制点,节点向量,权重等等。
  • 也输出NURBS曲面的离散化边界轮廓线。也就是线段连接而成的轮廓线,线段的顺序有待商榷。

A-9

  • 以下是完整代码:
#include <STEPControl_Reader.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <Geom_Surface.hxx>
#include <Geom_BSplineSurface.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include<TopExp.hxx>
#include<TopoDS.hxx>#include <GCPnts_UniformAbscissa.hxx> 
#include <GCPnts_UniformDeflection.hxx>
#include <Geom_BSplineCurve.hxx>
#include <BRepAdaptor_Curve.hxx> #include <iostream>
#include<fstream>std::vector<gp_Pnt> DiscretizeEdge_Uniform(const TopoDS_Edge& edge, int numPoints) {std::vector<gp_Pnt> points;BRepAdaptor_Curve curve(edge);GCPnts_UniformAbscissa abscissa(curve, numPoints);if (!abscissa.IsDone()) {std::cerr << "离散失败!" << std::endl;return points;}for (int i = 1; i <= abscissa.NbPoints(); ++i) {gp_Pnt p = curve.Value(abscissa.Parameter(i));points.push_back(p);}return points;
}
void ReadNurbs(TopoDS_Shape shape) {// 遍历所有的面TopTools_IndexedMapOfShape faceMap;TopExp::MapShapes(shape, TopAbs_FACE, faceMap);int NURBSFace_number = 0;for (int i = 1; i <= faceMap.Extent(); i++) {TopoDS_Face face = TopoDS::Face(faceMap(i));// 获取面上的曲面Handle(Geom_Surface) surface = BRep_Tool::Surface(face);// 如果是 NURBS 曲面if (surface->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {NURBSFace_number++;std::ofstream  file("NurbsFace_"+std::to_string( NURBSFace_number)+".txt");Handle(Geom_BSplineSurface) bsplineSurface = Handle(Geom_BSplineSurface)::DownCast(surface);TColStd_Array1OfReal uKnots = bsplineSurface->UKnotSequence();TColStd_Array1OfReal vKnots = bsplineSurface->VKnotSequence();int uDegree = bsplineSurface->UDegree();int vDegree = bsplineSurface->VDegree();file<< "UDegree: " << uDegree <<std::endl<< "VDegree: " << vDegree << std::endl << std::endl;file << "UKnots: ";for (int i = uKnots.Lower(); i <= uKnots.Upper(); ++i) {file << uKnots(i) << " ";}file << std::endl;file << "VKnots: ";for (int i = vKnots.Lower(); i <= vKnots.Upper(); ++i) {file << vKnots(i) << " ";}file << std::endl << std::endl;file << "ControlPoints:" << std::endl;// 输出曲面的控制点TColgp_Array2OfPnt controlPoints;Standard_Integer uCount = bsplineSurface->NbUPoles();Standard_Integer vCount = bsplineSurface->NbVPoles();for (Standard_Integer u = 1; u <= uCount; ++u) {for (Standard_Integer v = 1; v <= vCount; ++v) {file << bsplineSurface->Pole(u, v).X() << " " << bsplineSurface->Pole(u, v).Y()<< " " << bsplineSurface->Pole(u, v).Z() << " " << bsplineSurface->Weight(u, v) << std::endl;}}file << std::endl;file << " BoundaryPoints: " << std::endl;// 遍历面的所有边(轮廓线)TopExp_Explorer edgeExplorer(face, TopAbs_EDGE);int edgeCount = 0;while (edgeExplorer.More()) {TopoDS_Edge edge = TopoDS::Edge(edgeExplorer.Current());edgeCount++;auto v=DiscretizeEdge_Uniform(edge,50);for (int i = 0; i < v.size(); i++) {file << v[i].X() <<" " << v[i].Y() << " " << v[i].Z() << std::endl;}edgeExplorer.Next();}file.close();std::cout << "第" << NURBSFace_number << "个Nurbs曲面,输出成功" << std::endl;}}
}
TopoDS_Shape ReadFile(char* path) {STEPControl_Reader reader;reader.ReadFile(path);// Loads file MyFile.stp Standard_Integer NbRoots = reader.NbRootsForTransfer();// gets the number of transferable roots Standard_Integer NbTrans = reader.TransferRoots();// translates all transferable roots, and returns the number of    //successful translations return reader.OneShape();
}int main() {// 创建一个顶点或其他形状TopoDS_Shape shape= ReadFile((char*)"C:\\Model\\t.STEP");  std::cout << "读取成功" << std::endl;ReadNurbs(shape);return 0;
}
http://www.dtcms.com/wzjs/470068.html

相关文章:

  • wordpress4.9.4安装启动浙江网站seo
  • 手机优化电池充电是什么意思西安百度推广优化
  • 做网站商家seo技术助理
  • 旅行社网站建设规划书哈尔滨seo公司
  • 做绒毛鉴定网站今日十大新闻
  • 什么网站访问量新乡网站seo
  • 0基础自学做网站2020年度关键词有哪些
  • 网站里面添加支付怎么做持续优化疫情防控举措
  • 芜湖有没有做网站的今天微博热搜前十名
  • 济南建设公司网站百度站长工具网站提交
  • 学校网站在哪里找痘痘如何去除效果好
  • 做分销网站多少钱seo优化排名教程
  • wordpress 数据库备份插件优化推广
  • 卫计局网站建设信息公开总结推广关键词如何优化
  • 徐州网站建设哪家好今日新闻头条新闻
  • 在线做ps是什么网站网络销售平台排名前十
  • asp网站建设 文献域名解析ip138在线查询
  • 做网站模板的网页名称是m开头市场调研报告1500字
  • wordpress上传网站模板精准客户数据采集软件
  • 做彩投网站犯法吗最新新闻热点事件及评论
  • 织梦网站更改视频推广方案模板
  • 武清区网站开发营销推广策略
  • 中关村手机官网首页厦门网站seo
  • 阜阳微网站建设多少钱整站优化多少钱
  • wordpress中文企业主题下载宁波seo外包服务商
  • 免费做思维导图的网站合肥网络公司seo
  • 做户型图的网站在百度上做广告推广要多少钱
  • 做网站代理好吗搜百度盘
  • 做网站国外网站西安小程序开发的公司
  • 建设行政主管部门官方网站怎么制作一个自己的网站