Converting between ECS and WCS (outside of AutoCAD)

Status
Not open for further replies.

Rob Campbell

Usenet Archive
Joined
Jan 5, 2002
Messages
12
Reaction score
0
I'm writing a DXF exporter for a CAD system other than AutoCAD. DXF uses the Entity Coordinate System (ECS) to indicate the orientation of planar entities (e.g., arc) using a single vector. Ransen describes the ECS as "a terrible animal best left alone unless you really need it" in _AutoCAD Programming in C/C++_. Well, I need it. How would I convert to and from the ECS?

Thanks,
Rob Campbell
 
I've thought about it a little more. Please correct me if I have the wrong idea:

In the originating CAD system, the planar entity is defined in a UCS. The translation and rotation of this UCS relative to the WCS is readily available; it is not expressed as an ECS that must be decoded. Instead, I need to calculate the ECS that represents this transformation.

When I write a planar entity to a DXF file, I do not need to transform the individiual coordinates from the UCS to the ECS. I simply use the UCS coordinates. When the DXF file is imported into AutoCAD or another system, the transformation will take place then.

So to write an exporter, I only need to know how to calculate an ECS given a UCS (defined relative to the WCS). Eventually, I'd like to be able to import files as well. Then I will need to know how to calculate a UCS given an ECS.

Thanks,
Rob Campbell

"Rob Campbell" wrote:

I'm writing a DXF exporter for a CAD system other than AutoCAD. DXF uses the Entity Coordinate System (ECS) to indicate the orientation of planar entities (e.g., arc) using a single vector. Ransen describes the ECS as
"a
terrible animal best left alone unless you really need it" in _AutoCAD Programming in C/C++_. Well, I need it. How would I convert to and from the ECS?

Thanks,
Rob Campbell
 
I'm a little embarrassed. I see now that the DXF reference has sections on OCS (the new name for the ECS) and the arbitrary axis algorithm. I think I will find everything I need there. I would still benefit from a more general discussion of these ideas. So if anyone is willing to take time to respond, I would appreciate it.

Rob Campbell

"Rob Campbell" wrote:

I've thought about it a little more. Please correct me if I have the
wrong
idea:

In the originating CAD system, the planar entity is defined in a UCS. The translation and rotation of this UCS relative to the WCS is readily available; it is not expressed as an ECS that must be decoded. Instead, I need to calculate the ECS that represents this transformation.

When I write a planar entity to a DXF file, I do not need to transform the individiual coordinates from the UCS to the ECS. I simply use the UCS coordinates. When the DXF file is imported into AutoCAD or another
system,
the transformation will take place then.

So to write an exporter, I only need to know how to calculate an ECS given
a
UCS (defined relative to the WCS). Eventually, I'd like to be able to import files as well. Then I will need to know how to calculate a UCS
given
 
Rob,
There is a well know German fellow who wrote a book recently about dxf and that was the first place I heard about the arbitrary axis algorithm. Name escapes me but it went something like "Understanding AutoCAD Object Database". This book looked like the DXF ultimate resource.
Jim

"Rob Campbell" wrote:

I'm a little embarrassed. I see now that the DXF reference has sections
on
OCS (the new name for the ECS) and the arbitrary axis algorithm. I think
I
will find everything I need there. I would still benefit from a more general discussion of these ideas. So if anyone is willing to take time
to
respond, I would appreciate it.

Rob Campbell

"Rob Campbell" wrote:

> I've thought about it a little more. Please correct me if I have the wrong
> idea:
>
> In the originating CAD system, the planar entity is defined in a UCS.
The
> translation and rotation of this UCS relative to the WCS is readily
> available; it is not expressed as an ECS that must be decoded. Instead,
I
> need to calculate the ECS that represents this transformation.
>
> When I write a planar entity to a DXF file, I do not need to transform
the
> individiual coordinates from the UCS to the ECS. I simply use the UCS
> coordinates. When the DXF file is imported into AutoCAD or another system,
> the transformation will take place then.
>
> So to write an exporter, I only need to know how to calculate an ECS
given
a
> UCS (defined relative to the WCS). Eventually, I'd like to be able to
> import files as well. Then I will need to know how to calculate a UCS given
> an ECS.
 
Status
Not open for further replies.

Latest threads

Back
Top