![]() |
【转帖】rendering 9precision0
rendering (precision)
rendering (precision) hello, new dwgdirect library renders drawing into points with double precision. this is really a nice enhancement regarding old viewkit library. good work! while testing this new feature i found some problems: in paperspace i created a view on the model (two lines connected in one point), which is very far away. than i added new red line in paperspace view, which connects these two lines. i rendered this paperspace view into rectangle(0,0->100,100), and got following points: line1 (red): 55.011855,46.269315 -> 55.011847,46.269350 line 2: 54.972059,46.300682 -> 54.972038,46.300717 line3 54.972045,46.300682 -> 54.972059,46.300682 line 2 and line 3 are connected on one point, but line 1, which is drawn on paperspace viewport does not connect line2 and line 3. i tried to render this drawing also to rectangle (0,0->100.000,100.000) but i got the same result. is this a bug in the library or some kind of limitation? i am attaching my example drawing. i have another question regarding precision: circles are rendered as polylines. if circle is big enough, rendered polyline is similar to circle (it has some corners), but if circle is very small, than rendered polyline has only four corners (square). is it possible, to render circles depending on their radius? - so that rendered circles will always look similar to original entity? regards, tomaz. attached files hi, does anybody from opendwg know why precision problem occurs in dwgdirect 1.09 (patch)? regards, tomaz precision have you try the resview variable ? thanks, laurent hi lg, in which class can i find the resview variable? i have searched in many classes, but no success. regards, tomaz viewres hi, viewres is a system variable in autocad. try wrtriangulationparam class and odsettriangulationparams function thanks, laurent hi, lg, i have tried the wrtriangulationparam class and odsettriangulationparams function: { wrtriangulationparams params; params.normaltolerance = 1e-12; params.surfacetolerance = 1e-12; odsettriangulationparams(¶ms); // vectorize the dawing } i get the same result as before. is there any documentation about this class and function? (or maybe an example) what is the meaning of variables of the class wrtriangulationparam? regards, tomaz triangulation params effect only acis triangulation/rendering. curves tesselation (arcs, splines) depends on value returned by odgiabstractgeometry :: deviation() and modeldeviation() methods. in sample devices used by odamfcapp pixel size is taken into account to return proper deviation value. sergey slezkin hello, so, the only way to render each circle with the same number of line segment is to catch it before it is drawn, and correct the return value of deviation method, depending on circle's radius. but in my first (original) message, there was another question. why the drawing is not rendered correctly? even if i export it to dwf format, with odamfc application, i do not get the same result as in autocad. here i am sending another drawing with similar problem. (red lines, drawn into the paper space are not visible in dwf drawing). (export the drawing into dwf and zoom in into the center of circles). regards, tomaz attached files (31.5 kb, 5 views) if you override circle(), circulararc() methods in your geometry inheritor you can treat them as you like. default implementation tesselates them into polyline using value returned by deviation(). dwf format stores integer coordinates so if zoom is "very large" you can't see details less than 1 dwf logical unit. btw, dwf saved by autocad for your file does not allow to view your red paper space lines too. sergey slezkin sergey, since dwf file format stores integer coordinates, i guess that dwf export works ok. but i render the drawing into a format, which stores double coordinates. in first message i wrote, that dwgdirect rendering functionality returns coordinates, which are not correct (in double format): line3 is not connected to line1 and line2. but in autocad, all three lines are connected to each other. is this a bug in dwgdirect library? this problem is reproducible with the drawing attached to the first message in this thread. if you can not reproduce the problem, i can create a small example and send it to you. regards, tomaz |
所有的时间均为北京时间。 现在的时间是 05:16 AM. |