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