查看单个帖子
旧 2009-05-05, 11:21 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】getecs90

getecs()
getecs()
hi, i have a drawing that contains inserts with non-standard extrusions but the getecs() function always returns an identity matrix. is there another way to get the extrusion of an entity?

to get wcs to ocs transformation matrix use
odgematrix3d::wordtoplane(normal)
to get ocs to wcs -
odgematrix3d: lanetoworld(normal)
oddbblockreference has method blocktransform() which returns matrix composed of translation, rotation, scaling and normal (extrusion) direction - everything except block base point.
sergey slezkin
blocktransform
hi, i have used blocktransform() to find world coordinates, i made also a translation with position(), but it seems the transformation is incomplete, i suspect i should make another translation (maybe due to scale or rotation reference point)
thanks in advance
blocktransform matrix includes position(), rotation(), scale() and normal(). no need in processing them separately. if block's base point is non-zero it should be taken into consideration:
base point translation should be applied first.
note that if you have nested blocks you need to apply all blocktransforms() - use transformation stack.
sergey slezkin
thanks
it works!!!
thanks for such a quick answer.
my problem was that i was using the transposed matrix...
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)