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

个人做电梯网站企业网站优化技巧

个人做电梯网站,企业网站优化技巧,微商城开发公司,部门门户网站建设的目的1、通过参数进行分割 分别获得曲线的 FirstParameter 和 LastParameter ,然后对参数进行分割,获得n个ui,并对每个ui调用D0(获得这个点的坐标值)或D1(获得这个点的坐标值和切向量)。这个方法的优…

1、通过参数进行分割

分别获得曲线的 FirstParameter 和 LastParameter ,然后对参数进行分割,获得n个ui,并对每个ui调用D0(获得这个点的坐标值)或D1(获得这个点的坐标值和切向量)。这个方法的优点是,简单易行,好操作,缺点均分参数轴获得的曲线的分割可能不是均匀的。

#include <Geom_CylindricalSurface.hxx>
#include <gp_Ax3.hxx>
#include <GeomAPI_Interpolate.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <GCE2d_MakeSegment.hxx>
​
#include <GeomAPI_PointsToBSpline.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <GC_MakeCircle.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <GC_MakeArcOfCircle.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
​
#include <gp_GTrsf.hxx>
#include <BRepBuilderAPI_Transform.hxx>
​
#include"Viewer.h"
​
​
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_GTransform.hxx>
​
​
int main(int argc, char* argv[])
{gp_Dir  Z(0.0, 0.0, 1.0);gp_Pnt center(0, 0, 0.0);gp_Pnt xr(0.5, 0, 0.0);gp_Pnt yr(0.0, 1.0, 0.0);gp_Pnt zr(0.0, 0.0, 7.0);gp_Ax2  wb(center, Z);gp_Circ  wbcircle(wb, 0.125 / 2);TopoDS_Edge wbe = BRepBuilderAPI_MakeEdge(wbcircle);TopoDS_Edge xline = BRepBuilderAPI_MakeEdge(center, xr);TopoDS_Edge yline = BRepBuilderAPI_MakeEdge(center, yr);TopoDS_Edge zline = BRepBuilderAPI_MakeEdge(center, zr);gp_Pnt p1(-5, 0, 0.0);gp_Pnt p2(5, 0, 0.0);gp_Ax2  sr(center, Z);gp_Circ  bcircle(sr, 5);Handle(Geom_TrimmedCurve) bc = GC_MakeArcOfCircle(bcircle, p1, p2, 0);TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(bc);Standard_Integer splitN = 10;Standard_Real firstParam = bc->FirstParameter();Standard_Real lastParam = bc->LastParameter();Viewer vout(50, 50, 500, 500);for (Standard_Integer i = 0; i < splitN + 1; ++i){Standard_Real ui = i * (lastParam - firstParam) / splitN;gp_Pnt pi;gp_Vec veci;bc->D1(ui, pi, veci);TopoDS_Vertex verti = BRepBuilderAPI_MakeVertex(pi);vout << verti;}vout << anEdge;vout << xline;vout << yline;vout << zline;vout.StartMessageLoop();return 0;
}
​

2、直接对曲线分割

通过类 GCPnts_UniformAbscissa 实现对一个Geom_Curve对象的平均分割,获得分割点的坐标及对应的参数,将坐标和参数存入一个列表中,供其他操作使用。

#include <Geom_CylindricalSurface.hxx>
#include <gp_Ax3.hxx>
#include <GeomAPI_Interpolate.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <GCE2d_MakeSegment.hxx>
​
#include <GeomAPI_PointsToBSpline.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <GC_MakeCircle.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepOffsetAPI_MakePipe.hxx>
#include <GC_MakeArcOfCircle.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
​
#include <gp_GTrsf.hxx>
#include <BRepBuilderAPI_Transform.hxx>
​
#include"Viewer.h"
​
​
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <GCPnts_UniformAbscissa.hxx>
​
​
int main(int argc, char* argv[])
{gp_Dir  Z(0.0, 0.0, 1.0);gp_Pnt center(0, 0, 0.0);gp_Pnt xr(0.5, 0, 0.0);gp_Pnt yr(0.0, 1.0, 0.0);gp_Pnt zr(0.0, 0.0, 7.0);gp_Ax2  wb(center, Z);gp_Circ  wbcircle(wb, 0.125 / 2);TopoDS_Edge wbe = BRepBuilderAPI_MakeEdge(wbcircle);TopoDS_Edge xline = BRepBuilderAPI_MakeEdge(center, xr);TopoDS_Edge yline = BRepBuilderAPI_MakeEdge(center, yr);TopoDS_Edge zline = BRepBuilderAPI_MakeEdge(center, zr);gp_Pnt p1(-5, 0, 0.0);gp_Pnt p2(5, 0, 0.0);gp_Ax2  sr(center, Z);gp_Circ  bcircle(sr, 5);Handle(Geom_TrimmedCurve) bc = GC_MakeArcOfCircle(bcircle, p1, p2, 0);TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(bc);Standard_Integer splitN = 10;GeomAdaptor_Curve GAC(bc);GCPnts_UniformAbscissa UA(GAC, splitN + 1);gp_Pnt* pnts = new gp_Pnt[splitN + 1];Standard_Real* params = new Standard_Real[splitN + 1];Viewer vout(50, 50, 500, 500);if (UA.IsDone()){Standard_Real n = UA.NbPoints();Standard_Integer index = 0;for (; index < n + 1; index++){Standard_Real parami = UA.Parameter(index + 1);params[index] = parami;gp_Pnt tpnt;bc->D0(parami, tpnt);pnts[index] = tpnt;TopoDS_Vertex verti = BRepBuilderAPI_MakeVertex(tpnt);vout << verti;}}vout << anEdge;vout << xline;vout << yline;vout << zline;vout.StartMessageLoop();return 0;
}
​

http://www.mmbaike.com/news/98271.html

相关文章:

  • 莆田建设项目环境网站百度贴吧首页
  • 西安高端网站建设公司简单网页制作成品免费
  • 湖北广盛建设集团网站自己怎么创建网站
  • 怎么制作公众号文章搜索引擎seo优化平台
  • 门户网站做吗谷歌app下载
  • 福州在线山东进一步优化
  • 太原哪里做网站好娄底seo
  • 网站设计 趋势短视频培训机构排名
  • 美甲网站自适应源码营销网络的建设有哪些
  • 徐州企业网站排名优化百度首页登录官网
  • dw怎么做百度页面网站独立站平台选哪个好
  • 张店专业网站优化哪家好网站信息
  • 做产品设计之前怎么查资料国外网站公司域名注册查询
  • 在那些网站可以接兼职做官方正版清理优化工具
  • sql网站开发数据库连接失败网站优化关键词排名
  • 网站移动端优化工具青岛seo杭州厂商
  • 大好网站环球网
  • 做网站需要编程?整站seo优化
  • 大连专业手机自适应网站建设维护推广网络广告
  • 做汽车售后的网站百度竞价点击价格
  • 电脑iis做网站文章优化关键词排名
  • 有没有专业做电视测评的网站发稿
  • 什么网站可以做兼职美工seo公司哪家好用
  • 网站开发需要会啥吉林百度查关键词排名
  • 文化传媒有限公司网站建设百度网址安全中心
  • 软件系统开发报价表北京网优化seo优化公司
  • 运城市网站建设软件开发定制
  • wordpress移动端发表失败杭州关键词优化外包
  • 广州h5网站建设公司百度云搜索引擎网站
  • 西部数码创建php网站杭州最好的电商培训机构