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

网站建设好的公司wordpress和pageadmin

网站建设好的公司,wordpress和pageadmin,汕头企业网站建站模板,衡水wap网站建设费用目录 1、把曲线离散成点 1.1按数量离散 1.2按长度离散 1.3按弦高离散 2、由点合成曲线 2.1B样条插值 2.2B样条近似 1、把曲线离散成点 计算机图形学中绘制曲线#xff0c;无论是绘制参数曲线还是非参数曲线#xff0c;都需要先将参数曲线进行离散化#xff0c;通过离… 目录 1、把曲线离散成点 1.1按数量离散 1.2按长度离散 1.3按弦高离散 2、由点合成曲线 2.1B样条插值 2.2B样条近似 1、把曲线离散成点 计算机图形学中绘制曲线无论是绘制参数曲线还是非参数曲线都需要先将参数曲线进行离散化通过离散化得到一组离散化的点集然后再将点集发送给图形渲染管线进行处理最终生成我们想要的曲线。 OpenCASCADE中提供了GCPnts包。利用GCPnts包中提供的类我们可以很方便的将三维曲线进行离散化。 1.1按数量离散 #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_MakeVertex.hxx​#includeViewer.h​#include BRepAdaptor_CompCurve.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_Wire te BRepBuilderAPI_MakeWire(wbe); BRepAdaptor_CompCurve compCurve(te); GCPnts_UniformAbscissa uniAbs(compCurve, 100, -1); gp_Pnt p; Viewer vout(50, 50, 500, 500); vout te; if (uniAbs.IsDone()) { for (Standard_Integer i 1; i uniAbs.NbPoints(); i) { Standard_Real u uniAbs.Parameter(i); compCurve.D0(u, p);//获取每个离散点 TopoDS_Vertex verti BRepBuilderAPI_MakeVertex(p); vout verti; }​ } vout.StartMessageLoop(); return 0;} 1.2按长度离散 #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_MakeVertex.hxx​#includeViewer.h​#include BRepAdaptor_CompCurve.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_Wire te BRepBuilderAPI_MakeWire(wbe); BRepAdaptor_CompCurve compCurve(te); GCPnts_UniformAbscissa uniAbs; uniAbs.Initialize(compCurve, 0.05, -1); gp_Pnt p; Viewer vout(50, 50, 500, 500); vout te; if (uniAbs.IsDone()) { for (Standard_Integer i 1; i uniAbs.NbPoints(); i) { Standard_Real u uniAbs.Parameter(i); compCurve.D0(u, p);//获取每个离散点 TopoDS_Vertex verti BRepBuilderAPI_MakeVertex(p); vout verti; }​ } vout.StartMessageLoop(); return 0;} 1.3按弦高离散 #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 GCPnts_QuasiUniformDeflection.hxx#include BRepBuilderAPI_MakeVertex.hxx​#includeViewer.h​#include BRepAdaptor_CompCurve.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_Wire te BRepBuilderAPI_MakeWire(wbe); BRepAdaptor_CompCurve compCurve(te); GCPnts_QuasiUniformDeflection quasiUniDef; quasiUniDef.Initialize(compCurve, 0.08, GeomAbs_C0); gp_Pnt p; Viewer vout(50, 50, 500, 500); vout te; if (quasiUniDef.IsDone()) { for (Standard_Integer i 1; i quasiUniDef.NbPoints(); i) { pquasiUniDef.Value(i);//获取每个离散点 TopoDS_Vertex verti BRepBuilderAPI_MakeVertex(p); vout verti; }​ } vout.StartMessageLoop(); return 0;} 2、由点合成曲线 曲线曲面拟合Curve and Surface Fitting的方式可以分为两类插值interpolation和逼近approximation。采用插值的方式时所创建的曲线或曲面必须精确地满足所给的数据条件例如曲线通过所给的插值点。采用逼近的方式时创建的曲线或曲面不必精确地满足所给的数据条件只要在一定的误差范围内接近即可。 2.1B样条插值 #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 GCPnts_QuasiUniformDeflection.hxx #include BRepBuilderAPI_MakeVertex.hxx ​ #includeViewer.h ​ #include BRepAdaptor_CompCurve.hxx #include GeomTools.hxx ​ int main(int argc, char* argv[]) {Handle(TColgp_HArray1OfPnt) aPoints new TColgp_HArray1OfPnt(1, 3);Handle(Geom_BSplineCurve) aBSplineCurve; ​aPoints-SetValue(1, gp_Pnt(0.0, 0.0, 0.0));aPoints-SetValue(2, gp_Pnt(1.0, 1.0, 0.0));aPoints-SetValue(3, gp_Pnt(2.0, 6.0, 3.0)); ​GeomAPI_Interpolate aInterpolater(aPoints, Standard_False, Precision::Approximation());aInterpolater.Perform();aBSplineCurve aInterpolater.Curve();//std::cout ok;TopoDS_Edge s BRepBuilderAPI_MakeEdge(aBSplineCurve);Viewer vout(50, 50, 500, 500);vout s;vout BRepBuilderAPI_MakeVertex(aPoints-Value(1));vout BRepBuilderAPI_MakeVertex(aPoints-Value(2));vout BRepBuilderAPI_MakeVertex(aPoints-Value(3));vout.StartMessageLoop();return 0; } 2.2B样条近似 #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 GCPnts_QuasiUniformDeflection.hxx#include BRepBuilderAPI_MakeVertex.hxx​#includeViewer.h​#include BRepAdaptor_CompCurve.hxx#include GeomTools.hxx​int main(int argc, char* argv[]){ Handle(TColgp_HArray1OfPnt) aPoints new TColgp_HArray1OfPnt(1, 3); Handle(Geom_BSplineCurve) aBSplineCurve;​ aPoints-SetValue(1, gp_Pnt(0.0, 0.0, 0.0)); aPoints-SetValue(2, gp_Pnt(1.0, 1.0, 0.0)); aPoints-SetValue(3, gp_Pnt(2.0, 6.0, 3.0));​ GeomAPI_PointsToBSpline Approx(aPoints-Array1()); Handle(Geom_BSplineCurve) K Approx.Curve(); TopoDS_Edge s BRepBuilderAPI_MakeEdge(K); Viewer vout(50, 50, 500, 500); vout s; vout BRepBuilderAPI_MakeVertex(aPoints-Value(1)); vout BRepBuilderAPI_MakeVertex(aPoints-Value(2)); vout BRepBuilderAPI_MakeVertex(aPoints-Value(3)); vout.StartMessageLoop(); return 0;} ​
http://www.pierceye.com/news/603141/

相关文章:

  • 茂港网站建设公司妇科医院网站建设怎么做
  • 怎么自己改自己做的网站的图片策划案网站
  • 养殖p2p网站建设网址大全浏览器下载
  • 建立网站的过程沈阳做网站直播的公司
  • 沈阳市网站设计公司大全电商毕业设计作品
  • 做网站怎么赚钱滑县电桂林两江四湖景区导游词
  • 加快门户网站建设文网站建设费用计入什么科目
  • 网站建设合同英文模板下载湖州做网站的公司
  • 网站内容页设计济南网站优化
  • 简洁中文网站模板下载军事新闻头条最新消息
  • 湘潭网站建设 诚信磐石网络开发app软件的步骤
  • 阿里云网站备案网站建设方案书私有云可以建设网站
  • 网站建设如何增加流量做杂志的网站有哪些
  • 可信网站认证有用建设网站什么语言
  • 福州网站建设 大公司wordpress顺序
  • 为什么网站开发要用架构个人主页网站制作教程
  • 东莞教育网站建设做网站工资还没有文员高
  • 郑州网站制作工作室国内网站开发
  • 现在什么网站做外贸的最好wordpress window系统
  • 柬埔寨网赌网站开发新网络营销
  • html5毕业设计作品苏州关键词优化排名推广
  • 网站建设包括的内容相册在线设计平台
  • 花生壳可做网站吗微商城开发用华网天下首选
  • 口岸地区网站建设内容塔里木油田公司档案馆网站建设研究
  • 网站备案属于公司哪一块石家庄最新状况
  • 秦州建设网站免费代刷网站推广
  • 怎么查看一个网站是用什么程序做的我的家乡湛江网站设计
  • 沈阳网页模板建站开发手机app多少钱
  • 全国建设注册中心网站网页设计师培训价格
  • 做网站地图泰安百度公司代理商