几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】exploding oddbpolyline to geometric points (http://www.dimcax.com/hust/showthread.php?t=16206)

yang686526 2009-05-05 10:19 AM

【转帖】exploding oddbpolyline to geometric points
 
exploding oddbpolyline to geometric points
exploding oddbpolyline to geometric points
i have a 4-sided closed oddbpolyline which has varying width segments. i know that exploding it will loose the width information.
can i vectorize the above oddbpolyline to get all the geometric points?
i was exploring the odvectorizeex project. i didn't understand as to where the geometric points are stored?
more clarification on my question
when i explode a oddbpolyline, i loose the width information in the arcs ....can anybody confirm this?
can oda libs help me convert such arcs to closed polylines...so that i can retain the width information and have a geometric equivalence?
so i assume that above operation is not possible in oda and proceed to explore other ways to doing it.
is it possible to vectorize only a couple of selected entities? for example,
is it possible to vectorize only oddbpolyline having varying width edges?

quote:
originally posted by praveenvs
is it possible to vectorize only a couple of selected entities? for example,
is it possible to vectorize only oddbpolyline having varying width edges?
what i have done is as i iterate through the database, i vectorize certain objects with a little vectorizer as such :
class vectorizer : public odgigeometrysimplifier, public odgsbasevectorizeview {
public:
vectorizer() {
};
virtual void polylineout(odint32 n, const odgepoint3d* pts);
virtual void polygonout(odint32 nbpoints, const odgepoint3d *pvertexlist, const odgevector3d *pnormal = 0);
void setgmtryent(csmplptr apgmtry) { m_apgmtry = apgmtry;};
void setldr(copendwgptr apldr) { m_apldr = apldr;};
private:
csmplptr m_apgmtry;
copendwgptr m_apldr;
};
and then to vectorize the object i simply do the following code :
double de = odpolylineptr->defaultendwidth();
double ds = odpolylineptr->defaultstartwidth();
if( (de != 0.0f) || ( ds != 0.0f) ) {
odstaticrxobject<vectorizer> dv;
dv.setgmtryent(apent);
dv.setldr(this);
odstaticrxobject<odgicontextfordbdatabase> gicontext;
gicontext.setdatabase(odentptr->database());
dv.setdrawcontext(&dv);
dv.setcontext(&gicontext);
dv.output().setdestgeometry(dv);
dv.beginviewvectorization();
dv.draw(odpolylineptr);
dv.endviewvectorization();
} else {
// i vectorize it myself.
}
all other objects i vectorize myself.
obviosuly things like copendwgptr and csmplptr are my own classes, and you should substitute with your equiviants.
hope this helps.
cheers
jason


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