Hello all,
I want to define a list of elements (entities) and their geometry
primitives we want to provide in PythonCAD that are not yet supported.
The file format of PythonCAD is described in the pythoncad.xsd schema,
this the base of what a PythonCAD drawing can contain.
I think it is time to review this schema because it has an influence
on everything we want to do with PythonCAD.
This is very necessary because changes in the schema/drawing format
are time consuming to implement in PythonCAD.
What we have:
Current supported list of elements (from the pythoncad.xsd schema):
- Points
- Segments
- Circles
- Arcs
- HCLines
- VCLines
- ACLines
- CLines
- CCircles
- LDims
- HDims
- VDims
- RDims
- ADims
In PythonCAD there are more elements which are not described in the schema:
- TextBlock
- Polyline
- Fillets?
- Chamfer?
What we want:
Current unsupported list of elements/entities:
- polylines with arcs
- block definition and reference
- ellipse arc
- ellipse
- hatch
- polygon (as AutoCAD MPolygon, very similar to hatch)
- ...
In the current schema all the elements are described and each of them
has his own description of its geometry.
If you give the schema a second look you see that multiple elements
have a similar geometric primitive.
For instance:
A segment is a polyline with 2 points.
A circle is a arc with the start angle == end angle
etc.
It would be better to have one geometric primitive where all the
entities make use of it (if possible).
Future elements can also make use of this geometric primitive or a
group of primitives.
If we have only one geometric datatype the drawing of the entities is
much simpler (to maintain and for new elements).
Maybe a candidate for a geometric datatype is the oracle SDO_GEOMETRY
datatype (I have a GIS background thats why I chose this).
The only thing that is not directly supported is a ellipse.
The supported geometric types by the SDO_GEOMETRY datatype are (from
the oracle documentation):
POINT
Geometry contains one point.
* PythonCAD element Point
LINE or CURVE
Geometry contains one line string that can contain straight or
circular arc segments, or both. (LINE and CURVE are synonymous in this
context.)
* PythonCAD element Segment, Polyline (with and without arcs)
POLYGON
Geometry contains one polygon with or without holes.
* PythonCAD element Hatch and Polygon
COLLECTION
Geometry is a heterogeneous collection of elements. COLLECTION is a
superset that includes all other types.
MULTIPOINT
Geometry has one or more points. (MULTIPOINT is a superset of POINT.)
MULTILINE or MULTICURVE
Geometry has one or more line strings. (MULTILINE and MULTICURVE are
synonymous in this context, and each is a superset of both LINE and
CURVE.)
* PythonCAD element ellipse can be presented as a collection of arcs
MULTIPOLYGON
Geometry can have multiple, disjoint polygons (more than one exterior
boundary). (MULTIPOLYGON is a superset of POLYGON.)
* PythonCAD element Hatch and Polygon
I think this datatype is not suited for describing 3D elements but I
have no/very limited knowledge of 3D
Any thoughts on this?
Better, other ideas?
Regards,
Gertwin
|