使用C#三维图形控件进行曲线曲面分析
使用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#三维图形控件进行曲线曲面分析的更多相关文章
- 使用C#三维绘图控件快速搭建DXF查看程序
本例使用AnyCAD .Net三维图形控件快速实现一个DXF文件的读取.显示.导出JPG.PNG.PDF的应用. 代码: using System; using System.Collections. ...
- C# 历史曲线控件 基于时间的曲线控件 可交互的高级曲线控件 HslControls曲线控件使用教程
本篇博客主要对 HslControls 中的曲线控件做一个详细的教程说明,大家可以根据下面的教程开发出高质量的曲线控件 Prepare 先从nuget下载到组件,然后就可以使用组件里的各种组件信息了. ...
- HslControls组件库 工业控件库 曲线控件 时间控件 管道控件 温度计控件 阀门控件 传送带控件 进度条控件 电池控件 数码管控件等等
本篇博客主要对 HslControls 组件做一个大概的总览介绍,更详细的内容可以参照页面里的子链接,还有github上的源代码,然后进行相关的学习,和使用. Prepare 先从nuget下载到组件 ...
- 多比(SVG/VML)图形控件多比(SVG/VML)图形拓扑图控件免费下载地址
多比图形控件是一款基于Web(VML和SVG技术)的矢量图形控件, 类似于网页上的Visio控件拓扑图软件,是目前国内外最佳的基于web的工作流设计器.工作流流程监视器解决方案. 可广泛应用于包括:电 ...
- 在Qt中使用AnyCAD三维建模控件
AnyCAD C++ SDK专为Qt框架增加了AnyPlatformQt.lib模块,在Qt中使用AnyCAD三维建模控件变得十分简单. 下载 Qt高速下载:http://pan.baidu.com/ ...
- 在MFC程序中使用AnyCAD图形控件
AnyCAD图形控件有.Net版本和C++两个版本,使用C++要比C#稍微繁杂一点.SDK中提供了针对MFC的文档视图的封装,只需改一下几个基类即可. 准备 VS2010 下载C++版本的AnyCAD ...
- TControl.GetDeviceContext会给图形控件建立新的坐标原点和建立新的剪裁区域
这是取得DC句柄的其中一种方法(会重定义原点和建立新的剪裁区): function TControl.GetDeviceContext(var WindowHandle: HWnd): HDC; be ...
- SkylineGlobe 7.0.1 & 7.0.2版本Web开发 如何正确使用三维地图控件和工程树控件
Skyline TerraExplorer Pro目前正式发布的7.0.1&7.0.2版本,还只是64位的版本, 在Web开发的时候,如何在页面中正确嵌入三维地图控件,让一些小伙伴凌乱了. 下 ...
- 如何屏蔽SkylineGlobe提供的三维地图控件上的快捷键
SkyllineGlobe提供的 <OBJECT ID=" TerraExplorer3DWindow" CLASSID="CLSID:3a4f9192-65a8- ...
随机推荐
- Yii2.0 多文件上传
--------------------------------------------------------------------------------------------------- ...
- ios统计代码行数
要统计ios开发代码,包括头文件的,终端命令进入项目目录下,命令如下 列出每个文件的行数: find . -name "*.m" -or -name "*.h" ...
- mongodb csv 文件导入数据库,删除特定字段
1. 导入数据库 mongoimport -h host_ip -p port -d db_name -c collection_name --fields name1,name2,name3,nam ...
- Java中的Comparable<T>和Comparator<T>接口
有的时候在面试时会被问到Comparable<T>和Comparator<T>的区别(或者Java中两种排序功能的实现区别). 1) 在使用普通数组的时候,如果想对数据进行排序 ...
- iframe 跨域自适应 纯css解决方法
<style type="text/css">body{background:#f00;}body, html,#ifm1{width:100%;height:100% ...
- bash 学习笔记
shell:能够操作应用程序的接口就称为shell. Linux由C编写的. TAB键的使用 alias:设置别名
- 【转】又一波你可能不知道的 Linux 命令行网络监控工具
对任何规模的业务来说,网络监控工具都是一个重要的功能.网络监控的目标可能千差万别.比如,监控活动的目标可以是保证长期的网络服务.安全保护.对性能进行排查.网络使用统计等.由于它的目标不同,网络监控 ...
- dubbo服务框架学习
====================================================================================== 1.提供注册服务.消费者可 ...
- EF连接mysql数据库生成实体模型
声明:本人也是第一次用EF连接mysql生成实体模型 经过试验: mysql-connector-net-6.6.6 可以支持VS2012 mysql-connector-net-6.3.9 可以支持 ...
- Python计算程序运行时间
方法1 import datetime starttime = datetime.datetime.now() #long running endtime = datetime.datetime.no ...