几何尺寸与公差论坛------致力于产品几何量公差标准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-07, 05:22 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】roubles Exporting Dxf

troubles exporting dxf
troubles exporting dxf
hi people,
i m trying import dxf files to proprietary format. im using the odvectorizeex routines to make this.
well, its working but with only 2 troubles in 2 files send to me from 2 internal clients:
1) have a 2 lines with color mistakes (i can read another colors by table colors). the library read from file index_colors whit codes 30 and 185. how i can convert this colors to rgb format ?
2) have a 2 polylines but showed in diferent position from original file. when i show by vecad demo i can see correctly but in my application and in the export pdf option from odamfcapp show with small diference positions. im including in this post a zipfile with dxf file, log generated by odvectorizeex, pdf generated by odamfcapp and printscreen with my program and in a cad program. my application show dxf file like the pdf generated by odamfcapp but its not correct.
tks,
attached files
hi
1. cmcolor has method lookuprgb.
2. it is bug in exports. i think that your application has the same problem. in a few words bug is in the return value of odgigeometrysimplifier::deviation(). your application should set deviation to something reasonable by calling of setdeviation(). svg export (last 1.14 release) for example sets it to half of device pixel. mfcapp sets it to half of physical pixel size. so you need to do something like it in your application.
if you didn't set deviation, geometrysimplifier will use some default value and there is no guaranty that this value is good for your view. the result of wrong deviation is a wrong polyline drawing. dxf contains two entities, one of them is a polyline. middle segment of polyline is arc. arc drawing is a drawing of returned by appendsamplepoints polyline. with wrong deviation arc can be represented as line. your picture show it. good picture is result of good deviation, and wrong picture is a result of arc to line degeneration.
we will try to fix bugs on our side in our exports but we cannot fix it in your application. thank you for detailed report.
how to
quote:
originally posted by alexander rumyantsev
hi
1. cmcolor has method lookuprgb.
2. it is bug in exports. i think that your application has the same problem. in a few words bug is in the return value of odgigeometrysimplifier::deviation(). your application should set deviation to something reasonable by calling of setdeviation(). svg export (last 1.14 release) for example sets it to half of device pixel. mfcapp sets it to half of physical pixel size. so you need to do something like it in your application.
(...)
. good picture is result of good deviation, and wrong picture is a result of arc to line degeneration.
we will try to fix bugs on our side in our exports but we cannot fix it in your application. thank you for detailed report.
hi,
tks for your help.
the first item not work in moment but its not very important in moment. the line is orange (or marron) but its showing dark blue. its possibly trouble in an other source to my application.
but, im really starting in the dwgdirect and starting in cad tools too. i can develop the import routines simply coping the odvectorizeex with any changes but im not very sure about structures from this sample and from dwgdirect. how i can get pixel size or what is reasonable value for deviation ? in the odvectorizeex sample, where i can include setdeviation ?
[]s,
[]s,
celso
setdeviation
hi,
tks, i solve the color problem.
now have troubles only the 2 item.
im using the odvectorizeex routines in my program to export. i think make wrong changes but its minimal and work with only this problem.
now i need understand where i include the setdeviation and whats the reasonable value (or pixel value).
tks,
[]s,
celso
look here, please:
sergey slezkin
dont understand ...
quote:
originally posted by sergey slezkin
look here, please:
hi,
tkx for help but sorry, i dont understand...
i read the link, im search all threads with deviation word and read any but i dont understand where i need include setdeviation and how the reasonable value to set this.
im starting with this library and i dont understand very well this structures. in the moment, i try increase development simply copying the sample odvectoriseex without learn very much about this.
now im trying solve this problem but i think need learn more...
please, help me. i only need know this 2 informations...
[]s,
celso
debugging...
quote:
(...). the result of wrong deviation is a wrong polyline drawing. dxf contains two entities, one of them is a polyline. middle segment of polyline is arc. arc drawing is a drawing of returned by appendsamplepoints polyline. with wrong deviation arc can be represented as line. your picture show it. good picture is result of good deviation, and wrong picture is a result of arc to line degeneration.
we will try to fix bugs on our side in our exports but we cannot fix it in your application. thank you for detailed report.
hi,
im debugging odvectorizeex in my application and its call plineproc and polylineproc. dont pass by arc or circle procs... if have arc, it dont need call arcproc routines ?
help me ! dont leave me alone
[]s,
[]s,
celso
hi,
look at odgiconveyorgeometrydumper:lineproc, it has call of odgigeometrysimplifier:lineproc. this method breaks polyline segments (lines&arcs) to lines. the next code uses to break arc to lines inside odgigeometrysimplifier:lineproc.
code:
arc3d.getsamplepoints(arc3d.startang(), arc3d.endang(),
deviation(kodgimaxdevforcircle, arc3d.center()), m_points3d);
to fix problem with deviation in vectorizeex you need :
1. add next code to exgssimpledevice.cpp
code:
void exsimpleview::beginviewvectorization()
{
odgsbasevectorizeview::beginviewvectorization();
device()->setupsimplifier( &m_pmodeltoeyeproc->eyedeviation() );
}
void exgssimpledevice::setupsimplifier(const odgideviation* pdeviation)
{
m_pdestgeometry->setdeviation(pdeviation);
}
2. add next code to exgssimpledevice.h
to class exsimpleview in protected section
code:
virtual void beginviewvectorization();
and to class exgssimpledevice in public section
code:
void setupsimplifier(const odgideviation* pdeviation);
3. find in class exsimpleview method
code:
double deviation(const odgideviationtype, const odgepoint3d&) const
{
// to force dwgdirect vectorization framework to use some reasonable value.
return 0.;
}
and return here for example 1e-7. i think that problem with arc will be fixed. exports can be fixed in the same manner.
1e-7 should be changed to calculated deviation in the future. but i am not sure now how it can be calculated in vectorizeex.
quote:
originally posted by alexander rumyantsev
hi,
look at odgiconveyorgeometrydumper:lineproc, it has call of odgigeometrysimplifier:lineproc. this method breaks polyline segments (lines&arcs) to lines. the next code uses to break arc to lines inside odgigeometrysimplifier:lineproc.
(...)
1e-7 should be changed to calculated deviation in the future. but i am not sure now how it can be calculated in vectorizeex.
hi,
its work !
tank you very much ! ! !
[]s,
celso
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】oda 1.06 vs new 1.08 and 1.09 nls problem yang686526 DirectDWG 0 2009-05-06 06:50 PM
【转帖】german characters, export in dxf yang686526 DirectDWG 0 2009-05-05 11:13 AM
【转帖】dxf looks different from dwg yang686526 DirectDWG 0 2009-05-05 08:51 AM
【转帖】create dxf macro yang686526 SolidWorks二次开发 0 2009-04-13 10:00 AM
【转帖】auto create 11 flat pattern and save as dxf yang686526 SolidWorks二次开发 0 2009-04-13 09:08 AM


所有的时间均为北京时间。 现在的时间是 01:09 PM.


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