about libdxfrw and global coordinates

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

about libdxfrw and global coordinates

vbmacit
Hi,

I am using your lib to make simple gnu lib for dxf and dwg exporter for qt. I ve looked your example code dwg2dxf exporter it's ok but my problem about to dind entities exact coordination(global)

how can i obtain all items global coordinates

for example

I get problematics coordinates i just need to find global coordiantion of items but still no lock

an example code to get postion of arc I wrote. If you help me I really more than happy

Best Regards...

void vkfCadHandler::addArc(const DRW_Arc &data)
{
    if(!data.visible)
        return;

    QString LineType=QString::fromStdString(data.lineType).toUpper();
    QPen InternalPen=Pen;

    if(LineType!="CONTINUOUS" && LineType!="BYLAYER" && LineType!="ACAD_ISO03W100")
    {
        InternalPen.setStyle(Qt::DashLine);
    }


    vkfCadEllipseItem *Ellipse=new vkfCadEllipseItem(data.basePoint.x-data.radious, -data.basePoint.y-data.radious,
                                                        data.radious*2.0, data.radious*2.0);

    Ellipse->setPen(InternalPen);
    Ellipse->setSelected(false);
    Scene->addItem(Ellipse);

    if(data.isccw)
    {
        Ellipse->setStartAngle(16*((180*data.staangle)/(atan(1.0)*4)));
        Ellipse->setSpanAngle(16*((180*data.endangle)/(atan(1.0)*4))+Ellipse->startAngle());
    }
    else
    {
        Ellipse->setStartAngle(16*((180*data.staangle)/(atan(1.0)*4)));
        Ellipse->setSpanAngle(16*((180*data.endangle)/(atan(1.0)*4))-Ellipse->startAngle());
    }
}
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: about libdxfrw and global coordinates

dxli
Administrator
hi vbmacit,

since the dxf/dwg part is by Rallaz, I can not really answer this question :(

Hope Rallaz can offer his help.

vbmacit wrote
Hi,

I am using your lib to make simple gnu lib for dxf and dwg exporter for qt. I ve looked your example code dwg2dxf exporter it's ok but my problem about to dind entities exact coordination(global)

how can i obtain all items global coordinates

for example

I get problematics coordinates i just need to find global coordiantion of items but still no lock

an example code to get postion of arc I wrote. If you help me I really more than happy

Best Regards...

void vkfCadHandler::addArc(const DRW_Arc &data)
{
    if(!data.visible)
        return;

    QString LineType=QString::fromStdString(data.lineType).toUpper();
    QPen InternalPen=Pen;

    if(LineType!="CONTINUOUS" && LineType!="BYLAYER" && LineType!="ACAD_ISO03W100")
    {
        InternalPen.setStyle(Qt::DashLine);
    }


    vkfCadEllipseItem *Ellipse=new vkfCadEllipseItem(data.basePoint.x-data.radious, -data.basePoint.y-data.radious,
                                                        data.radious*2.0, data.radious*2.0);

    Ellipse->setPen(InternalPen);
    Ellipse->setSelected(false);
    Scene->addItem(Ellipse);

    if(data.isccw)
    {
        Ellipse->setStartAngle(16*((180*data.staangle)/(atan(1.0)*4)));
        Ellipse->setSpanAngle(16*((180*data.endangle)/(atan(1.0)*4))+Ellipse->startAngle());
    }
    else
    {
        Ellipse->setStartAngle(16*((180*data.staangle)/(atan(1.0)*4)));
        Ellipse->setSpanAngle(16*((180*data.endangle)/(atan(1.0)*4))-Ellipse->startAngle());
    }
}
Loading...