彩票走势图

VectorDraw Developer Framework使用教程:如何裁切多面体

原创|使用教程|编辑:郝浩|2013-05-22 15:50:07.000|阅读 671 次

概述:本文用VectorDraw Developer Framework的 vdCurve object 裁剪一个多面体,并用这个对象在多面体上裁切圆形或矩形等形状。

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

相关链接:

我们都知道,VectorDraw Developer Framework可以对3D视图进行随意裁切。下面我将用 vdCurve object 裁剪一个多面体,并用这个对象在多面体上裁切圆形或矩形等形状。

从VectorDraw v6.024开始,添加了以下方法到vdPolyface object:

summary>Cuts this polyface using the passed vdCurve object.
param name="curve">A vdCurve object to be used in order to cut the polyface. You can use a circle , rect , ellipse , polyline and cut a polyface object.
param name="sideToKeep">A gPoint in WCS that represents the side of the polyface to keep.This point is relative to the vdCurve object.
param name="CreateCoverFaces">A boolean value representing if extra faces will be added in order to cover the cutted edges.
param name="CreatedFacesEdgesVisibility">A boolean value representing the edges visibility of the created cover faces.
returns>True if the command was succesfull.
public bool Cut(vdCurve curve , gPoint sideToKeep , bool CreateCoverFaces ,bool CreatedFacesEdgesVisibility)

 

同时还要添加一个方法到vdDocument object的CommandLine:

summary>Changes the passed polyface so it is cut with the passed curve. A point is also asked to determine which part of the polyface will be kept.
param name="polyface">The polyface object to cut OR null , "USER" so the user picks the polyface.
param name="curve">A vdCurve object OR null,"USER" so the user picks the curve.
param name="sideToKeep">A gPoint object or null,"USER" so the user picks a point on the screen. This point represents the side of the polyface that is going to be kept.
param name="CoverFaces">A boolean value OR null,"USER" so the user is prompted for a Yes/No answer. This boolean value represents if cover faces are going to be created where the polyface is going to be cutted.
returns>True if the command was succesfull.
remarks>This command is very usefull in order to slice a polyface with a curve and create various 3D objects. You can also use closed curves like circle,rects etc.. to create holes to a polyface.
public bool CmdCutPolyface(object polyface, object curve , object sideToKeep , object CoverFaces)

 

这个命令可以以这种形式进行调用:doc.CommandAction.CmdCutPolyface(null, null, null, true);

空参数会迫使库提示用户选择一个多面体、曲线和点。这个命令对于3D对象的创建非常有用。

下面绿色的曲线是vdArcs,红色的矩形框是由cmdBox创建的:

VectorDraw,cmdBox

在rendermode下经过四次剪切后的效果:

ItemsarcsResult,VectorDraw

下图中绿色的部分是vdRect objects,红色的部分是由cmdBox创建的多边形盒子,同时在中间添加一个圆:

ItemsCone,cmdBox,VectorDraw

同样,在rendermode下经过五次剪切后的效果如下:

ItemsConeResult,rendermode,VectorDraw

当然还可以作出更复杂的效果,如红色的椎体和绿色的折线结合:

ItemsRectsResult,矩形框,VectorDraw,折线

ItemsRectsResult,矩形框,VectorDraw


标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@cahobeh.cn

文章转载自:慧都控件

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP