VectorDraw Developer Framework(VDF)是一个用于应用程序可视化的图形引擎库。有了VDF提供的功能,您可以轻松地创建、编辑、管理、输出、输入和打印2D和3D图形文件。

VectorDraw web library (javascript)不仅能打开CAD图纸,而且能显示任何支持HTML5标准平台上的通用矢量对象,如Windows,安卓,iOS和Linux。无需任何安装,VectorDraw web library (javascript)就可以运行在任何支持canvas标签和Javascript的主流浏览器(Chrome, Firefox, Safari, Opera, Dolphin, Boat等等)中。这意味着可以用DXF,DWG,DGN,SKP(Google的Sketchup),VDML等多种格式在任何台式、平板电脑,智能手机和便携式笔记本上展现出你的业务。


问:

如何才能创建一些3D对象?

答:

您可以使用一些基本功能和对象在VDF中创建的3D对象。

一、使用CommandAction方法,如:

 private void button1_Click(object sender, EventArgs e){Doc = vdFramedControl1.BaseControl.ActiveDocument;gPoints pts = new gPoints(); pts.Add(new gPoint(-16, 0)); pts.Add(new gPoint(-14, 0)); pts.Add(new gPoint(-14, 3)); pts.Add(new gPoint(-16, 3));Doc.CommandAction.Cmd3dFace(pts); // create a 3D face from 4 pointspts = new gPoints(); pts.Add(new gPoint(-12, 0, 0)); pts.Add(new gPoint(-10, 0, -1)); pts.Add(new gPoint(-8, 0, 0)); pts.Add(new gPoint(-5, 0, 0));pts.Add(new gPoint(-12, 3, 1)); pts.Add(new gPoint(-10.5, 2.7, -1)); pts.Add(new gPoint(-8, 3, 0)); pts.Add(new gPoint(-5, 3.2, 0));pts.Add(new gPoint(-12, 6, 0)); pts.Add(new gPoint(-10.5, 5.7, 4)); pts.Add(new gPoint(-8, 6, 1)); pts.Add(new gPoint(-5, 5.8, 1));pts.Add(new gPoint(-12.5, 9, -0.5)); pts.Add(new gPoint(-10.5, 9.2, 2)); pts.Add(new gPoint(-8, 9.1, 0)); pts.Add(new gPoint(-5, 8.8, 0));Doc.CommandAction.Cmd3DMesh(4, 4, pts); // create a vdPolyface MESH that is made by 16 pointsDoc.CommandAction.CmdSphere(new gPoint(0,0,0),3.0d,32,16); // create a sphereDoc.CommandAction.CmdCone(new gPoint(7, 0, 0), 3.0d, 1.0d, 10.0d, 30);// create a coneDoc.CommandAction.CmdBox3d(new gPoint(11, 0, 0), 4.0d, 2.0d, 3.0d, 0.0d); // create a orthogonal 6-side boxDoc.CommandAction.CmdTorus(new gPoint(19, 0), 2.0D, 0.5D, 30, 20); // create a torus}

二、通过使用vdPolyface对象的代码:

 private void button2_Click(object sender, EventArgs e){Doc = vdFramedControl1.BaseControl.ActiveDocument;int[] array_faces = {1, 2, 5, 4, 116,  // connect vertexes 1, 2, 5 and 4 to one face with color 1167, 8, 3, 3, 116, 7, 12, 3, 3, 116, 8, 3, 6, 9, 116, 3, 12, 11, 6, 116, 6, 9, 10, 10, 116, 6, 10, 11, 11, 116, 7, 8, 14, 13, -1, 14, 15, 25, 8, -1, 15, 16, 9, 25, -1, 9, 10, 17, 16, -1, 17, 18, 11, 10, -1,11, 26, 19, 18, -1, 12, 26, 19, 20, -1, 7, 12, 20, 13, -1, 20, 19, 23, 24, -1, 14, 15, 22, 21, -1, 15, 19, 23, 22, -1, 14, 20, 24, 21, -1, 21, 22, 23, 24, -1, 13, 14, 20, 20, 2, 16, 17, 18, 18, 2, 15, 16, 18, 19, 2};Int32Array faces = new Int32Array(array_faces);gPoints pts = new gPoints();pts.Add(2, 0, 0);pts.Add(3, 0, 0);pts.Add(1, 0, 1);pts.Add(2.2, 0, 1);pts.Add(3.8, 0, 1);pts.Add(5, 0, 1);pts.Add(0, 0, 2);pts.Add(1, 1, 2);pts.Add(5.5, 1, 2);pts.Add(7, 0, 2);pts.Add(5.5, -1, 2);pts.Add(1, -1, 2);pts.Add(-0.5, 0, 3);pts.Add(0.5, 1.5, 3);pts.Add(3.5, 1.7, 3);pts.Add(6, 1.5, 3);pts.Add(8, 0, 3);pts.Add(6, -1.5, 3);pts.Add(3.5, -1.7, 3);pts.Add(0.5, -1.5, 3);pts.Add(0.5, 1, 4);pts.Add(3, 1, 4);pts.Add(3, -1, 4);pts.Add(0.5, -1, 4);pts.Add(3.25, 1, 2);pts.Add(3.25, -1, 2);vdPolyface pFace = new vdPolyface(Doc, pts, faces); // create the vdPolyface and Doc.Model.Entities.AddItem(pFace); // add it to the documentDoc.CommandAction.View3D("VISW");Doc.CommandAction.View3D("SHADE");}

三、使用Generate3DPathSection:

private void button3_Click(object sender, EventArgs e){Doc = vdFramedControl1.BaseControl.ActiveDocument;//create an oval tube vdEllipse ci = new vdEllipse(Doc, new gPoint(), 0.03, 0.02, 0, 0, 0); // Doesn't need to be in the documentVertexes verts = new Vertexes();verts.Add(0, 0, 0, 0); verts.Add(0, 1, 0, -0.5); verts.Add(1, 1, 0, 0.2); verts.Add(1, 2, 0, 0);vdPolyline pline = new vdPolyline(Doc, verts);// Doesn't need to be in the document//We will use a polyline  as path and an ellipse as section which ellipse is going to go round the polyline and create the polyface needed.vdPolyface pface = new vdPolyface();pface.SetUnRegisterDocument(Doc);pface.setDocumentDefaults();pface.setDocumentDefaults();pface.Generate3dPathSection(pline, ci, new gPoint(0, 0.0, 0.0), 0, 1);Doc.Model.Entities.AddItem(pface); // add the polyface to the document.}

四、使用GroundSurface:

检查AddEntities Sample和GroundSurface按钮,点击那里的代码。

五、通过切割(切片)现有的多面体:

 private void button4_Click(object sender, EventArgs e){Doc = vdFramedControl1.BaseControl.ActiveDocument;Doc.New();if (Doc.CommandAction.CmdSphere(new gPoint(0, 0, 0), 3.0d, 32, 16))  // create a sphere{vdPolyface pface = Doc.Model.Entities[Doc.Model.Entities.Count - 1] as vdPolyface;if (pface != null){pface.PenColor.FromSystemColor(Color.PowderBlue);pface.Slice(new gPoint(-0.5, 0, 0), new Vector(-1, 0, 0), true, true);pface.Slice(new gPoint(0, -1, 0), new Vector(-1, -1, 0), false,true); // do not cover this sliceDoc.CommandAction.View3D("SHADE");}}}

六、通过使用具有厚度的vdPolyHatch对象和ToMesh()函数将其转换为vdPolyface对象,如:

   private void button5_Click(object sender, EventArgs e){double dLength = 400; double dDInterior = 100; double dDExterior = 200; double dSpecial = 10;double dHelp = dDInterior - dSpecial;Doc = vdFramedControl1.BaseControl.ActiveDocument;Doc.New();vdPolyline oPLine = new vdPolyline(); oPLine.SetUnRegisterDocument(Doc); oPLine.setDocumentDefaults();oPLine.VertexList.Add(new Vertex(dDExterior / 2, 0, 0, 1));oPLine.VertexList.Add(new gPoint(-dDExterior / 2, 0, 0));oPLine.VertexList.Add(new Vertex(-dDExterior / 2, 0, 0, 1));oPLine.Flag = VectorDraw.Professional.Constants.VdConstPlineFlag.PlFlagCLOSE;vdPolyline oPLine2 = new vdPolyline(); oPLine2.SetUnRegisterDocument(Doc); oPLine2.setDocumentDefaults();oPLine2.VertexList.Add(new Vertex(dDInterior / 2, -dSpecial / 2, 0, -1));oPLine2.VertexList.Add(new gPoint(-dDInterior / 2, -dSpecial / 2, 0));oPLine2.Flag = VectorDraw.Professional.Constants.VdConstPlineFlag.PlFlagCLOSE;vdPolyline oPLine3 = new vdPolyline(); oPLine3.SetUnRegisterDocument(Doc); oPLine3.setDocumentDefaults();oPLine3.VertexList.Add(new Vertex(dDInterior / 2, dSpecial / 2, 0, 1));oPLine3.VertexList.Add(new gPoint(-dDInterior / 2, dSpecial / 2, 0));oPLine3.Flag = VectorDraw.Professional.Constants.VdConstPlineFlag.PlFlagCLOSE;VectorDraw.Professional.vdCollections.vdCurves curves_Outer = new VectorDraw.Professional.vdCollections.vdCurves();curves_Outer.AddItem(oPLine);VectorDraw.Professional.vdCollections.vdCurves curves_Inside = new VectorDraw.Professional.vdCollections.vdCurves();curves_Inside.AddItem(oPLine2);curves_Inside.AddItem(oPLine3);//'create polyhatchvdPolyhatch onehatch = new vdPolyhatch();onehatch.SetUnRegisterDocument(Doc);onehatch.setDocumentDefaults();onehatch.PolyCurves.AddItem(curves_Outer);onehatch.PolyCurves.AddItem(curves_Inside);onehatch.HatchProperties = new VectorDraw.Professional.vdObjects.vdHatchProperties(VectorDraw.Professional.Constants.VdConstFill.VdFillModeSolid);onehatch.Thickness = dLength;//'create polyhatchvdPolyface oPFace = onehatch.ToMesh(0);oPFace.PenColor.FromSystemColor(Color.Purple);Doc.Model.Entities.AddItem(oPFace);Doc.CommandAction.View3D("VISE");Doc.CommandAction.View3D("SHADE");Doc.Model.ZoomExtents();}

七、通过使用vdPolyface对象的cut命令。

param name =curve>用于剪切多面的vdCurve对象。您可以使用圆,矩形,椭圆,折线和切割多面体对象。

VectorDraw入门必备手册(十):如何创建一些3D对象?相关推荐

  1. C++编程入门系列之十四(类与对象:构造函数和析构函数)

    C++编程入门系列之十四(类与对象:构造函数和析构函数) 鸡啄米上一节中给大家讲解了类的声明.成员的访问控制和对象,今天鸡啄米给大家讲C++编程入门时同样必须掌握的构造函数和析构函数.从上一讲开始已经 ...

  2. Civil 3D 二次开发 创建Civil 3D 对象—— 00 ——

    本节中我们通过创建几何空间点.曲面和采样线了解Civil 3D对象的创建方法.因Civil 3D对象的创建方法相比AutoCAD对象创建要简单的多,比如创建一个几何空间点,最简单的情况采用一行代码(没 ...

  3. w3cc离线版手册_web前端入门必备手册,离线w3school参考手册

    w3school离线手册2017手册是一款官方编译的w3school最新2020.3月版离线手册,可以让您在离线的时候能够查询到需要的信息,马上下载2020最新w3school离线版手册吧. 简要描述 ...

  4. freehand8_在Illustrator和Freehand中创建仿制3D图形

    freehand8 In this second article of our vector graphics series, we'll take the basics that were cove ...

  5. 【技术手册】Java 开发者必备手册《Spring Cloud Alibaba 从入门到实战》

    Java 开发者必备手册<Spring Cloud Alibaba 从入门到实战> 简介 大咖寄语 目录 精彩导读 基础知识篇 分布式配置 服务注册与发现 分布式服务调用 服务熔断和限流 ...

  6. 网站推广必备手册:SEO教程:搜索引擎优化入门与进阶(第2版)

    网站推广必备手册:SEO教程:搜索引擎优化入门与进阶(第2版) [作 者]吴泽欣 [同作者作品] [作译者介绍]  [丛 书 名] 图灵程序设计丛书  [出 版 社] 人民邮电出版社     [书 号 ...

  7. Spring 从入门到精通 (十六) AOP底层如何创建动态代理类

    关键词:Spring | AOP | 创建代理类 | 底层 本专栏通过理论和实践相结合,系统学习框架核心思想及简单原理,原创不易,如果觉得文章对你有帮助,点赞收藏支持博主 ✨ 目录 一.创建对象三要素 ...

  8. v2视频服务器退出系统怎么启动,V2视频会议系统入门操作手册.doc

    V2视频会议系统入门操作手册 登陆方式 打开IE(浏览器),用户访问服务器地址00,进入V2 Conference系统主界面. 首次登录视频会议服务器,系统会自动提示客户端下载安装客户端插件,用户也可 ...

  9. jQuery Mobile高手必备的十大技巧和代码片段

    本文转自51ito布加迪编译版本: http://mobile.51cto.com/hot-276160.htm 其中未发现英文原作链接,为尊重版权,google之后附上: http://www.we ...

最新文章

  1. FarBox--另类有趣的网站服务【转】
  2. 【Spring源码】Spring中的AOP底层原理分析
  3. OpenCV4 DNN模块 Python APIs
  4. MongoDB数据库索引基础知识与实战技巧
  5. 支持向量机SVM 简要推导过程
  6. python dict update保持顺序_Python OrderedDict不保持元素顺序 - python
  7. ubuntu共享usb接口给虚拟机_如何在虚拟机的Ubuntu12.04中使用外部USB设备
  8. ArcGIS server for java 安装配置一 续
  9. 用ASP.NETCore构建可检测的高可用服务
  10. boost.asio学习
  11. 显微镜自动聚焦原理是什么_自动玻璃感应门原理是什么?看看东莞装修网怎么说...
  12. 有趣的HTML实例(十五) 注册登录界面(css+js)
  13. DeepMind VS Meta:实现纳什均衡理性最优解,还是多人非零和博弈算法更强大?
  14. 5G应用创新发展策略研究
  15. 计算机科学与技术博士论文,计算机科学与技术一级学科博士研究生发表学术论文量化标准.pdf...
  16. 屏蔽ip段访问 html,限制某IP段对网页的访问(ASP)
  17. Java 生成 OFD 文档
  18. DC/DC电源的延时计算
  19. 给满分为其点赞的增值税发票OCR扫描识别系统
  20. AI算法工程师笔试经验分享 | 【是你等的那一篇推文吗?】

热门文章

  1. 手头有65万,想在广州买房,买南沙好还是黄埔好?
  2. 短信宝+发送短信验证码
  3. Evosuite用maven构建(内附详细过程)
  4. 关于gzip zgrep zcat 的使用
  5. TCP 为什么三次握手而不是两次握手(正解版)
  6. sublime基本使用
  7. Kubernetes CoreDNS 详解
  8. 利用队列输出杨辉三角 C语言
  9. matlab的for语句条件,matlabfor语句条件
  10. 文献丨GWAS分析菜用大豆可溶性糖含量调控基因