![]() |
【转帖】hatch loop with one edge will not give sample points
hatch loop with one edge will not give sample points
hatch loop with one edge will not give sample points i am trying to display a dwg file with a hatched ellipse in it. i have written a function which read out the edges of the hatch with appendsamplepoints(...), and this works for all hatches except the 1 line loops (with a circle of an ellipse). dwgdirect crashes on the edges.getat(0)->appendsamplepoints(...) code. help me! regards, chiel the loop has one edge? line, circle or ellipse? could you provide a sample? sergey slezkin quote: originally posted by sergey slezkin the loop has one edge? line, circle or ellipse? could you provide a sample? if i draw just a circle or an ellipse and hatch this one solid, then my module crashes odamfcapp sample renders such hatches correctly. could you provide some code to be inserted into one of our samples to reproduce the crash? for example into debugcommand.h of odamfcapp sample. this code gets executed if edit/run debug command is invoked. sergey slezkin a debug trace shows me the appendsamplepoints(...) functions throws an exception in odgeelliparc2d::hasstartpoint()... i think something like this should reproduce the crash. btw. the code is untested in this form code: void extern_debugcommand(codamfcappdoc* pdoc, cdwgview* pview) { oddbobject pents = pdoc->getmodelspaceid().safeopenobject(oddb::kforread) oddbobjectiteratorptr pentiter = pents->newiterator(); for(pentiter->start(); !pentiter->done(); pentiter->step()) { oddbentityptr pentity = pentiter->enity(); if(!strcmp(pentity->isa()->name(),"acdbhatch")) { oddbhatchptr phatch = pentity->objectid().safeopenobject(); for(int i=0; i<phatch->numloops(); i++) { edgearray edges; phatch->getloopat(i,edges); for(int j=0; j<edges.length(); j++) { odgepoint2darray pointarray; edges.getat(j)->appendsamplepoints( 16, pointarray); } } } } } i can't reproduce the crash with this code. btw, which dd version do you use? sergey slezkin we ware using dwgdirect version 1.11... i just upgraded to 1.12, and that solves the problem. thanks for your time, sergey slezkin! |
所有的时间均为北京时间。 现在的时间是 09:28 AM. |