几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-05, 10:43 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】extrusion vectors

extrusion vectors
extrusion vectors
i'm not sure how to handle extrusion vectors. to get the coordinates of an oddbarc, for example, do i just call?:
oddbarcptr parc = oddbarc::cast(pent);
parc->transformby(odgematrix3d:lanetoworld(parc->normal());

is this how you do it? any help would be appreciated.
void maybe(oddbarcptr parc)
{
odgematrix3d coordsysmat;
odgevector3d xaxis, yaxis, zaxis, normal, tmpnormal;
normal = parc->normal();
zaxis = normal;
tmpnormal = normal;
if ((fabs(normal.x) < 0.015625) && (fabs(normal.y) < 0.015625))
{
tmpnormal.x = normal.z;
tmpnormal.y = 0.0;
tmpnormal.z = -normal.x;
normal = tmpnormal;
}
else
{
tmpnormal.x = normal.y;
tmpnormal.y = normal.x;
tmpnormal.z = 0.0;
}
normal = tmpnormal;
xaxis = normal.perpvector();
yaxis = zaxis.crossproduct(xaxis); // get the y axis
coordsysmat.setcoordsystem(odgepoint3d::korigin, xaxis, yaxis, normal);
parc->transformby(coordsysmat);
}
when the dxf data is read in from file the coordinates are placed into wcs using towcscenter(). so the data you retrieve from your arc should already be in the wcs.
just for you info- these are the two methods we apply to switch between wcs and ocs for circle derived entities:
odgepoint3d m_center;
void towcscenter()
{
if (normal() != odgevector3d::kzaxis)
{
m_center.transformby(odgematrix3d:lanetoworld(no rmal()));
}
}
odgepoint3d ocscenter() const
{
odgepoint3d rescenter(m_centere);
if (normal() != odgevector3d::kzaxis)
{
rescenter.transformby(odgematrix3d::worldtoplane(n ormal()));
}
return rescenter;
}
i understand your respond to mean that i do not have to transform the oddbarc. am i correct is saying that all arcs in a dxf file are drawn counter-clockwise? if so, the problem i am having is that all arcs with an extrusion vector of (0,0,-1) seem to be going clockwise.
post me an example to look at.
all the arcs with a normal of (0,0,-1) are going clockwise instead of counter-clockwise.
acdbarc
arc (-399, -148.5, 0) to (-399, -162.5, 0) center (-399, -155.5, 0)
normal: (0, 0, 1)
start angle: 1.5708
end angle: 4.71239
acdbarc
arc (-399, -160.75, 0) to (-399, -150.25, 0) center (-399, -155.5, 0)
normal: (0, 0, -1)
start angle: 4.71239
end angle: 1.5708
acdbarc
arc (-360.026, -154.903, 0) to (-367, -148.5, 0) center (-367, -155.5, 0)
normal: (0, 0, 1)
start angle: 0.0853085
end angle: 1.5708
acdbarc
arc (-367, -150.25, 0) to (-367, -160.75, 0) center (-367, -155.5, 0)
normal: (0, 0, -1)
start angle: 1.5708
end angle: 4.71239
acdbarc
arc (-367, -162.5, 0) to (-360, -155.5, 0) center (-367, -155.5, 0)
normal: (0, 0, 1)
start angle: 4.71239
end angle: 0
attached files (30.7 kb, 17 views)
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
when i am picking features off of surfed cad data i am seeing vectors of .98900. if i huangyhg PC-DMIS 0 2009-04-06 11:19 PM


所有的时间均为北京时间。 现在的时间是 11:23 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多