使用AnyCAD.Net三维图图形控件能够计算曲线的切线、法线、曲率、长度等,能够计算曲面的uv切线、法线、面积等。

代码示例一:曲线分析

            Platform.LineStyle lineStyle = new Platform.LineStyle();
lineStyle.SetLineWidth(0.5f);
lineStyle.SetColor(ColorValue.BLUE);
Platform.LineStyle lineStyle2 = new Platform.LineStyle();
lineStyle2.SetLineWidth(0.5f);
lineStyle2.SetColor(ColorValue.GREEN); Platform.TopoShape arc = renderView.ShapeMaker.MakeEllipseArc(Vector3.ZERO, , , , , Vector3.UNIT_Z);
renderView.ShowGeometry(arc, ); {
Platform.GeomeCurve curve = new Platform.GeomeCurve();
curve.Initialize(arc); float paramStart = curve.FirstParameter();
float paramEnd = curve.LastParameter(); float step = (paramEnd - paramStart) * 0.1f; for (float uu = paramStart; uu <= paramEnd; uu += step)
{
Vector3 dir = curve.DN(uu, );
Vector3 pos = curve.Value(uu); // 切线
{
Platform.TopoShape line = renderView.ShapeMaker.MakeLine(pos, pos + dir);
Platform.SceneNode node = renderView.ShowGeometry(line, );
node.SetLineStyle(lineStyle);
}
// 法线
{
Vector3 dirN = dir.CrossProduct(Vector3.UNIT_Z);
Platform.TopoShape line = renderView.ShapeMaker.MakeLine(pos, pos + dirN);
Platform.SceneNode node = renderView.ShowGeometry(line, );
node.SetLineStyle(lineStyle2);
} } }

运行结果:

代码示例二:曲面分析

            Platform.LineStyle lineStyle = new Platform.LineStyle();
lineStyle.SetLineWidth(0.5f);
lineStyle.SetColor(ColorValue.RED); TopoShape arc = renderView.ShapeMaker.MakeArc(Vector3.ZERO, , -, , Vector3.UNIT_X);
TopoShape face = renderView.ShapeMaker.Extrude(arc, , Vector3.UNIT_X); renderView.ShowGeometry(face, ); GeomeSurface surface = new GeomeSurface();
surface.Initialize(face);
float ufirst = surface.FirstUParameter();
float uLarst = surface.LastUParameter();
float vfirst = surface.FirstVParameter();
float vLast = surface.LastVParameter(); float ustep = (uLarst - ufirst) * 0.1f;
float vstep = (vLast - vfirst) * 0.1f;
for(float ii=ufirst; ii<=uLarst; ii+= ustep)
for (float jj = vfirst; jj <= vLast; jj += vstep)
{
Vector3List data = surface.D1(ii, jj); Vector3 pos = data.Get();
Vector3 dirU = data.Get();
Vector3 dirV = data.Get();
Vector3 dir = dirV.CrossProduct(dirU);
{
Platform.TopoShape line = renderView.ShapeMaker.MakeLine(pos, pos + dir);
Platform.SceneNode node = renderView.ShowGeometry(line, ); node.SetLineStyle(lineStyle);
}
}

运行结果

使用C#三维图形控件进行曲线曲面分析的更多相关文章

  1. 使用C#三维绘图控件快速搭建DXF查看程序

    本例使用AnyCAD .Net三维图形控件快速实现一个DXF文件的读取.显示.导出JPG.PNG.PDF的应用. 代码: using System; using System.Collections. ...

  2. C# 历史曲线控件 基于时间的曲线控件 可交互的高级曲线控件 HslControls曲线控件使用教程

    本篇博客主要对 HslControls 中的曲线控件做一个详细的教程说明,大家可以根据下面的教程开发出高质量的曲线控件 Prepare 先从nuget下载到组件,然后就可以使用组件里的各种组件信息了. ...

  3. HslControls组件库 工业控件库 曲线控件 时间控件 管道控件 温度计控件 阀门控件 传送带控件 进度条控件 电池控件 数码管控件等等

    本篇博客主要对 HslControls 组件做一个大概的总览介绍,更详细的内容可以参照页面里的子链接,还有github上的源代码,然后进行相关的学习,和使用. Prepare 先从nuget下载到组件 ...

  4. 多比(SVG/VML)图形控件多比(SVG/VML)图形拓扑图控件免费下载地址

    多比图形控件是一款基于Web(VML和SVG技术)的矢量图形控件, 类似于网页上的Visio控件拓扑图软件,是目前国内外最佳的基于web的工作流设计器.工作流流程监视器解决方案. 可广泛应用于包括:电 ...

  5. 在Qt中使用AnyCAD三维建模控件

    AnyCAD C++ SDK专为Qt框架增加了AnyPlatformQt.lib模块,在Qt中使用AnyCAD三维建模控件变得十分简单. 下载 Qt高速下载:http://pan.baidu.com/ ...

  6. 在MFC程序中使用AnyCAD图形控件

    AnyCAD图形控件有.Net版本和C++两个版本,使用C++要比C#稍微繁杂一点.SDK中提供了针对MFC的文档视图的封装,只需改一下几个基类即可. 准备 VS2010 下载C++版本的AnyCAD ...

  7. TControl.GetDeviceContext会给图形控件建立新的坐标原点和建立新的剪裁区域

    这是取得DC句柄的其中一种方法(会重定义原点和建立新的剪裁区): function TControl.GetDeviceContext(var WindowHandle: HWnd): HDC; be ...

  8. SkylineGlobe 7.0.1 & 7.0.2版本Web开发 如何正确使用三维地图控件和工程树控件

    Skyline TerraExplorer Pro目前正式发布的7.0.1&7.0.2版本,还只是64位的版本, 在Web开发的时候,如何在页面中正确嵌入三维地图控件,让一些小伙伴凌乱了. 下 ...

  9. 如何屏蔽SkylineGlobe提供的三维地图控件上的快捷键

    SkyllineGlobe提供的 <OBJECT ID=" TerraExplorer3DWindow" CLASSID="CLSID:3a4f9192-65a8- ...

随机推荐

  1. 模拟实现兼容低版本IE浏览器的原生bind()函数功能

    模拟实现兼容低版本IE浏览器的原生bind()函数功能: 代码如下: if(!Function.prototype.bind){   Function.prototype.bind=function( ...

  2. 通过IP连接网上打印机(转载)

    From:http://zhidao.baidu.com/link?url=YZzFWur4-UZrNEobHv9zTkbYocMAjKkCq0LBj1QjJ6wApUT7MljxoD8JMBREUH ...

  3. Linux Shell入门(转载)

    From:http://www.cnblogs.com/suyang/archive/2008/05/18/1201990.html 从程序员的角度来看, Shell本身是一种用C语言编写的程序,从用 ...

  4. htmlparser日记

    myParser = Parser.createParser(response, "utf-8");NodeFilter tableFilter = new NodeClassFi ...

  5. git重写历史记录

    1 修改上一次历史提交,替换掉上次的提交git commit --amend 2 git rebase 将不同分支路径合并到同一分支路径上eg:将master分支上的 conflic rebase合并 ...

  6. 配置nginx下别名alias支持PHP fastcgi解析

    1)参看如下连篇文章:Nginx设置alias实现虚拟目录 alias与root的用法区别http://down.chinaz.com/server/201111/1382_1.htmNginx下al ...

  7. 性能测试工具Gatling - 设置Recorder

    Gatling自带的Recorder,可以大大节省我们书写scenario的时间.     用法和selenium的IDE类似,作为一个代理服务器在browser和application之间做桥梁作用 ...

  8. jenkins参数化构建过程

    http://www.cnblogs.com/meitian/p/5492457.html 1,首先增加Jenkisn插件 https://wiki.jenkins-ci.org/display/JE ...

  9. Oracle逻辑读详解

    1.物理读(physical read) 当数据块第一次读取到,就会缓存到buffer cache 中,而第二次读取和修改该数据块时就在内存buffer cache 了 以下是例子: 1.1  第一次 ...

  10. MapHttpRoute

    http://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Web.Http/HttpRouteCollectionExten ...