HALCON Reference Manual 10.0.2
Table of Contents / File / XLD ClassesClassesClasses | | | Operators

read_contour_xld_dxfread_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxf (Operator)

Name

read_contour_xld_dxfread_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxf — Read XLD contours from a DXF file.

Signature

read_contour_xld_dxf( : Contours : FileName, GenParamNames, GenParamValues : DxfStatus)

Herror read_contour_xld_dxf(Hobject* Contours, const char* FileName, const char* GenParamNames, double GenParamValues, char* DxfStatus)

Herror T_read_contour_xld_dxf(Hobject* Contours, const Htuple FileName, const Htuple GenParamNames, const Htuple GenParamValues, Htuple* DxfStatus)

Herror read_contour_xld_dxf(Hobject* Contours, const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, char* DxfStatus)

Herror read_contour_xld_dxf(Hobject* Contours, const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* DxfStatus)

HXLDCont HXLDCont::ReadContourXldDxf(const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, char* DxfStatus)

HXLDContArray HXLDContArray::ReadContourXldDxf(const HTuple& FileName, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* DxfStatus)

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

VARIANT HXLDContX.ReadContourXldDxf(
[in] BSTR FileName, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues)

static void HOperatorSet.ReadContourXldDxf(out HObject contours, HTuple fileName, HTuple genParamNames, HTuple genParamValues, out HTuple dxfStatus)

HTuple HXLDCont.ReadContourXldDxf(string fileName, HTuple genParamNames, HTuple genParamValues)

string HXLDCont.ReadContourXldDxf(string fileName, string genParamNames, double genParamValues)

Description

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

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

The operator read_contour_xld_dxfread_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxf 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 contours ContoursContoursContoursContourscontours. The z coordinates of the DXF entities are ignored.

If the file has been created with the operator write_contour_xld_dxfwrite_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxf, all attributes and global attributes that were originally defined for the XLD contours are read. This means that read_contour_xld_dxfread_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxf supports all the extended data written by the operator write_contour_xld_dxfwrite_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxf. The reading of these attributes can be switched off by setting the generic parameter 'read_attributes'"read_attributes""read_attributes""read_attributes""read_attributes" to 'false'"false""false""false""false". Generic parameters are set by specifying the parameter name(s) in GenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames and the corresponding value(s) in GenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues.

DXF entities of the type CIRCLE, ARC, ELLIPSE, and SPLINE are approximated by XLD contours. 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" and '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"). The parameter '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" 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" 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" defines the maximum deviation of the XLD contour 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" must be increased or the value for 'max_approx_error'"max_approx_error""max_approx_error""max_approx_error""max_approx_error" must be decreased.

Parallelization

Parameters

ContoursContoursContoursContourscontours (output_object)  xld_cont(-array) objectHXLDContHXLDContHXLDContXHobject *

Read XLD contours.

FileNameFileNameFileNameFileNamefileName (input_control)  filename.read HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Name of the DXF file.

File extension: .dxf

GenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames (input_control)  attribute.name(-array) HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

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

Default value: []

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

GenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues (input_control)  attribute.value(-array) HTupleHTupleVARIANTHtuple (real / integer / string) (double / int / long / string) (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: 'true'"true""true""true""true", 'false'"false""false""false""false", 0.1, 0.25, 0.5, 1, 2, 5, 10, 20

DxfStatusDxfStatusDxfStatusDxfStatusdxfStatus (output_control)  string(-array) HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Status information.

Result

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

Possible Predecessors

write_contour_xld_dxfwrite_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxf

See also

write_contour_xld_dxfwrite_contour_xld_dxfwrite_contour_xld_dxfWriteContourXldDxfWriteContourXldDxf, read_polygon_xld_dxfread_polygon_xld_dxfread_polygon_xld_dxfReadPolygonXldDxfReadPolygonXldDxf, query_contour_attribs_xldquery_contour_attribs_xldquery_contour_attribs_xldQueryContourAttribsXldQueryContourAttribsXld, query_contour_global_attribs_xldquery_contour_global_attribs_xldquery_contour_global_attribs_xldQueryContourGlobalAttribsXldQueryContourGlobalAttribsXld, get_contour_attrib_xldget_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXld, get_contour_global_attrib_xldget_contour_global_attrib_xldget_contour_global_attrib_xldGetContourGlobalAttribXldGetContourGlobalAttribXld

Module

Foundation


Table of Contents / File / XLD ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH