VectorDraw剪切多面体的方法

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

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

1
2
3
4
5
6
7
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:

1
2
3
4
5
6
7
8
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


* 点击查看VectorDraw更多相关文档

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值