高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】adtdirect wall geometry
adtdirect wall geometry
adtdirect wall geometry
hello,
i’m using adtdirect and i want to get the 3d geometry for wall aecdbwall with elinear wall type. i can get length, width, height, 3d start and end points. but this is not enough to determinate all geometry in space.
how can i get it? may i get a 3d vector which determinates a direction in space or some other location properties?
thanks in advance.
hello, dynamo
all adt entities including aecdbwall have the transformation matrix.
it can be obtained by getmatrix method (aecdbgeo member).
for linear wall - x axis of this matrix defines the direction from start to end.
but this transformation, length, depth and height do not fully describe the geometry of the wall. it can store a lot of other modifiers and properties and actually may consist of multiple parallel components.
for example, i attached the file with a wall that has two components.
regards,
vladimir alekseev
attached files (445.5 kb, 14 views)
hello,
how can i get the position of a wall with ebaseline justification?
may i get edge offset or something else like that?
thanks in advance.
quote:
originally posted by dynamo
hello,
how can i get the position of a wall with ebaseline justification?
may i get edge offset or something else like that?
thanks in advance.
hello,
i will explain it here for linear wall case.
// wall transform.
odgematrix3d mmatrix = pwall->getmatrix();
// the length of the linear wall is measured along this x axis:
odgevector3d vxaxis = pwall->getcsxaxis();
// the offset for start and end of component's width is measured along y axis.
odgevector3d vyaxis = pwall->getcsyaxis();
// we will need base wall width:
double dbasewidth = pwall->getwidth();
for each wall component (obtained form wall style):
aecwallstylecompptr pwallcomp = pwallstyle->getcomponentcount( index );
aecwallstylecompposptr pwallcompposition = pwallcomp->getposition();
double dcompwidth = pwallcompposition->getwidth()->getvalue( dbasewidth );
double dcompoffset = pwallcompposition->getwidth()->getedgeoffset( dbasewidth );
y axis +
dcompwidth+dcompoffset--end of component width---|
| |
0--------------------------baseline-----------------length---x axis +
| |
dcompoffset---------------start of component width--|
y axis -
in case of other type of justification the behaviour is different:
if dmin is the minimum point for all component along y axis
and dmax is the maximum point then the dimension of resulting wall along its y axis is
[ 0, dmax - dmin] - for eright case.
[ dmin - dmax, 0] - for eleft case.
[ (dmin - dmax) / 2, (dmax - dmin) / 2] - for ecetner case.
and for the ebaseline case (see picture) it is [ dmin, dmax ].
since next version, which will be available after dd1.13
wall style will have this method:
odgeinterval getrealwidth( double dbasewidth ) const.
it allows to obtain [dmin, dmax] interval.
here is its implementation:
double dmin = 1e10, dmax = -1e10;
if( 0 < getcomponentcount() )
{
oduint32 i, isize = getcomponentcount();
for( i = 0; i < isize; i++ )
{
aecwallstylecompptr pcomponent = getcomponentbyindex( i );
aecwallstylecompposptr pcomponentpos = pcomponent->getposition();
double dvalue1 = pcomponentpos->getedgeoffset()->getvalue( dbasewidth );
double dvalue2 = dvalue1 + pcomponentpos->getwidth()->getvalue( dbasewidth );
if ( dvalue1 > dmax ) dmax = dvalue1;
if ( dvalue1 < dmin ) dmin = dvalue1;
if ( dvalue2 > dmax ) dmax = dvalue2;
if ( dvalue2 < dmin ) dmin = dvalue2;
}
}
return odgeinterval( dmin, dmax );
regards,
vladimir alekseev
last edited by vladimir alekseev; 24th february 2005 at 12:51 amfff">.
thank you, for such a detail explanation. this really helped.
|