当前位置: 首页 > 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/71602.html

相关文章:

  • 免费域名网站php网站一般怎么推广
  • 哪个公司制作网站好如何注册网站免费注册
  • 淘客怎么样做网站浙江搜索引擎优化
  • html电影网站模板下载工具刷链接浏览量网站
  • 给企业做网站的公司sem推广是什么意思呢
  • 石家庄网站建设接单合肥网站优化公司
  • pc端网站设计规范泸州网站优化推广
  • 新乡营销网站建设百度关键词推广价格
  • 做网站接活犯法吗烟台seo
  • 鲅鱼圈企业网站建设google搜索引擎官网
  • 电子商务网站建设招标书seo每天一贴
  • 昆明网站运营公司有哪些谷歌推广哪家公司好
  • 网站制作 杭州公司竞价推广代运营服务
  • 织梦怎么建设论坛网站免费建站网站一站式
  • 学校建设网站费用申请亚马逊seo什么意思
  • 网站做软件seo网站推广报价
  • 北京企业响应式网站建设可以免费发布广告的平台有哪些
  • windows主机 wordpress 防盗链酒泉网站seo
  • 南京做公司网站公司seo教程自学入门教材
  • 建设官网网站平台接广告在哪里接的
  • 太原做网站联系方式全面落实疫情防控优化措施
  • wordpress主题升级文件杭州seo排名优化外包
  • 网页制作与网站开发百度账号申诉
  • 网站做收录是什么意思必应收录提交入口
  • 网站的虚拟人怎么做的关键词难易度分析
  • wordpress 上传权限设置seo优化实训报告
  • 网络营销导向企业网站建设的一般原则外包公司软件开发
  • 回龙观做网站湖南正规seo优化
  • 广州优质网站建设案例站长工具seo综合查询降级
  • 网站建设应该学什么网络营销方案如何写