ClassesClassesClassesClasses | | | | Operators

read_polygon_xld_dxfread_polygon_xld_dxfReadPolygonXldDxfread_polygon_xld_dxfReadPolygonXldDxfReadPolygonXldDxf (Operator)

Name

read_polygon_xld_dxfread_polygon_xld_dxfReadPolygonXldDxfread_polygon_xld_dxfReadPolygonXldDxfReadPolygonXldDxf — Read XLD polygons from a DXF file.

Signature

read_polygon_xld_dxf( : Polygons : FileName, GenParamNames, GenParamValues : DxfStatus)

Herror read_polygon_xld_dxf(Hobject* Polygons, const char* FileName, const char* GenParamNames, double GenParamValues, char* DxfStatus)

Herror T_read_polygon_xld_dxf(Hobject* Polygons, const Htuple FileName, const Htuple GenParamNames, const Htuple GenParamValues, Htuple* DxfStatus)

Herror read_polygon_xld_dxf(Hobject* Polygons, const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, char* DxfStatus)

Herror read_polygon_xld_dxf(Hobject* Polygons, const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* DxfStatus)

HXLDPoly HXLDPoly::ReadPolygonXldDxf(const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, char* DxfStatus)

HXLDPolyArray HXLDPolyArray::ReadPolygonXldDxf(const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* DxfStatus)

void ReadPolygonXldDxf(HObject* Polygons, const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* DxfStatus)

HTuple HXLDPoly::ReadPolygonXldDxf(const HString& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues)

HString HXLDPoly::ReadPolygonXldDxf(const HString& FileName, const HString& GenParamNames, double GenParamValues)

HString HXLDPoly::ReadPolygonXldDxf(const char* FileName, const char* GenParamNames, double GenParamValues)

void HOperatorSetX.ReadPolygonXldDxf(
[out] IHUntypedObjectX*Polygons, [in] VARIANT FileName, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* DxfStatus)

VARIANT HXLDPolyX.ReadPolygonXldDxf(
[in] BSTR FileName, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues)

static void HOperatorSet.ReadPolygonXldDxf(out HObject polygons, HTuple fileName, HTuple genParamNames, HTuple genParamValues, out HTuple dxfStatus)

HTuple HXLDPoly.ReadPolygonXldDxf(string fileName, HTuple genParamNames, HTuple genParamValues)

string HXLDPoly.ReadPolygonXldDxf(string fileName, string genParamNames, double genParamValues)

Description

read_polygon_xld_dxfread_polygon_xld_dxfReadPolygonXldDxfread_polygon_xld_dxfReadPolygonXldDxfReadPolygonXldDxf reads the contents of the DXF file FileNameFileNameFileNameFileNameFileNamefileName (DXF version AC1009, AutoCAD Release 12) and converts them to the XLD polygons PolygonsPolygonsPolygonsPolygonsPolygonspolygons. If no absolute path is given in FileNameFileNameFileNameFileNameFileNamefileName the DXF file is searched in the current directory of the HALCON process.

The output parameter DxfStatusDxfStatusDxfStatusDxfStatusDxfStatusdxfStatus contains information about the number of polygons that were read and, if necessary, warnings that parts of the DXF file could not be interpreted.

The operator read_polygon_xld_dxfread_polygon_xld_dxfReadPolygonXldDxfread_polygon_xld_dxfReadPolygonXldDxfReadPolygonXldDxf supports the following DXF entities:

The x and y coordinates of the DXF entities are stored in the column and row coordinates, respectively, of the XLD polygons PolygonsPolygonsPolygonsPolygonsPolygonspolygons. The z coordinates of the DXF entities are ignored.

DXF entities of the type CIRCLE, ARC, ELLIPSE, and SPLINE are approximated by XLD polygons. The accuracy of this approximation can be controlled with the two generic parameters 'min_num_points'"min_num_points""min_num_points""min_num_points""min_num_points""min_num_points" and 'max_approx_error'"max_approx_error""max_approx_error""max_approx_error""max_approx_error""max_approx_error" (for SPLINE only 'max_approx_error'"max_approx_error""max_approx_error""max_approx_error""max_approx_error""max_approx_error"). Generic parameters are set by specifying the parameter name(s) in GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames and the corresponding value(s) in GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues. The parameter 'min_num_points'"min_num_points""min_num_points""min_num_points""min_num_points""min_num_points" defines the minimum number of sampling points that are used for the approximation. Note that the parameter 'min_num_points'"min_num_points""min_num_points""min_num_points""min_num_points""min_num_points" always refers to the full circle or ellipse, respectively, even for ARCs or elliptical arcs, i.e., if 'min_num_points'"min_num_points""min_num_points""min_num_points""min_num_points""min_num_points" is set to 50 and a DXF entity of the type ARC is read that represents a semi-circle, this semi-circle is approximated by at least 25 sampling points. The parameter 'max_approx_error'"max_approx_error""max_approx_error""max_approx_error""max_approx_error""max_approx_error" defines the maximum deviation of the XLD polygon from the ideal circle or ellipse, respectively (unit: pixel). For the determination of the accuracy of the approximation both criteria are evaluated. Then, the criterion that leads to the more accurate approximation is used.

Internally, the following default values are used for the generic parameters:

To achieve a more accurate approximation, either the value for 'min_num_points'"min_num_points""min_num_points""min_num_points""min_num_points""min_num_points" must be increased or the value for 'max_approx_error'"max_approx_error""max_approx_error""max_approx_error""max_approx_error""max_approx_error" must be decreased.

Note that reading a DXF file with read_polygon_xld_dxfread_polygon_xld_dxfReadPolygonXldDxfread_polygon_xld_dxfReadPolygonXldDxfReadPolygonXldDxf results in exactly the same geometric information as reading the file with read_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxf. However, the resulting data structure is different.

Parallelization

Parameters

PolygonsPolygonsPolygonsPolygonsPolygonspolygons (output_object)  xld_poly(-array) objectHXLDPolyHXLDPolyHXLDPolyHXLDPolyXHobject *

Read XLD polygons.

FileNameFileNameFileNameFileNameFileNamefileName (input_control)  filename.read HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name of the DXF file.

File extension: .dxf

GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames (input_control)  attribute.name(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Names of the generic parameters that can be adjusted for the DXF input.

Default value: []

List of values: 'max_approx_error'"max_approx_error""max_approx_error""max_approx_error""max_approx_error""max_approx_error", 'min_num_points'"min_num_points""min_num_points""min_num_points""min_num_points""min_num_points"

GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues (input_control)  attribute.value(-array) HTupleHTupleHTupleVARIANTHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*) (double / Hlong / BSTR) (double / Hlong / char*)

Values of the generic parameters that can be adjusted for the DXF input.

Default value: []

Suggested values: 0.1, 0.25, 0.5, 1, 2, 5, 10, 20

DxfStatusDxfStatusDxfStatusDxfStatusDxfStatusdxfStatus (output_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Status information.

Result

If the parameters are correct and the file could be read the operator read_polygon_xld_dxfread_polygon_xld_dxfReadPolygonXldDxfread_polygon_xld_dxfReadPolygonXldDxfReadPolygonXldDxf returns the value 2 (H_MSG_TRUE). Otherwise, an exception is raised.

Possible Predecessors

write_polygon_xld_dxfwrite_polygon_xld_dxfWritePolygonXldDxfwrite_polygon_xld_dxfWritePolygonXldDxfWritePolygonXldDxf

See also

write_polygon_xld_dxfwrite_polygon_xld_dxfWritePolygonXldDxfwrite_polygon_xld_dxfWritePolygonXldDxfWritePolygonXldDxf, read_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxf

Module

Foundation


ClassesClassesClassesClasses | | | | Operators