高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】reading spatial filters
reading spatial filters
reading spatial filters
i wish to read spatial filters from a dwg file. i found how to get some of the information, but cannot see how to get the tranform which is at the end of the object in a dxf file (the one described as "this matrix transforms points into the coordinate system of the clip boundary " in autocad's dxf docs). am i missing something or is that not yet available.
i think it makes sense to add such function to oddbspatialfilter interface but it can be contructed from normal and elevation returned by getdefinition():
odgematrix3d::worldtoplane(normal) * odgematrix3d::translation(odgevector3d(0.,0.,-elevation)),
sergey slezkin
more on transforms
thank you. i now think i need the other (inverse block insertion) transform (probably as well-i don't think i really understand the way the transforms work yet)!
what i need is the boundary in either the coordinates of the block being inserted (assume that i've clipped a block insertion with the xclip command) or in the coordinates of the drawing (wcs). if i get one of those i can get the other using the current transform for the block insertion, which may not be the same as that included (as an inverse) in the spatial filter.
the case i want to "work" is that i have a block reference (in my case to an xref) with non-zero rotation. i apply a clipping rectangle to it, and then select it and rotate it (this is what makes the 2 "block insertion" tranforms different-the clipping rectangle is now not). the result of this is a clipping rectangle which is not aligned with the x-y axes.
i see. the matrix which is the inverse of the original block reference transformation is required if block reference transformation was changed after creating spatial filter.
we'll add methods to get both spatial filter matrices.
sergey slezkin
hi sergey,
i have a problem about transforming the spatial filter boundary into wcs. actually i have a file with only one block ref and i get some coordinates but none of the retrieved transformations can move them where they should be. i put some debug output window content here:
item=spatial
origin: (0.000000, 0.000000, 0.000000) // p->origin ()
normal: (0.000000, 0.000000, 1.000000) // p->normal ()
pt[0] = (-30048.018507, 61747.955593)// p->boundary ()
pt[1] = (-16313.461306, 79717.294142)
// p->getdefinition () data
origin: (0.000000, 0.000000, 0.000000)
normal: (0.000000, 0.000000, 1.000000)
transformation from model to clip space:
origin: (0.000000, 0.000000, 0.000000)
x axis: (1.000000, 0.000000, 0.000000)
y axis: (0.000000, 1.000000, 0.000000)
z axis: (0.000000, 0.000000, 1.000000)
transformation from block space to world:
origin: (9715842.031662, 5158644.595362, 0.000000)
x axis: (1.000000, 0.000000, 0.000000)
y axis: (0.000000, 1.000000, 0.000000)
z axis: (0.000000, 0.000000, 1.000000)
pt[0] = (-30048.018507, 61747.955593)
pt[1] = (-16313.461306, 79717.294142)
but the boundary box should be about (83000,19000) to (97000,36000)
could you help me? if you need the file to find it out i'll send it.
thank you
tibor
|