Transform DXF coordinates on the canvas to geographic coordinates
pysaman
10/9/2017 12:30 PM
|
---|
Hello . I Imported a DXF file using the Cadillib library inside the WPF program Written With C#. Then I turned it into a XAML file by XAMLExporter. I showed XAML file in Canvas. XAMLExporter uses a 4-dimensional matrix for mapping. The question is, what method should I use to look at the UTM coordinates of the Canvas by moving the mouse? This is my Code :
C# Code: public void ExportToXaml( |
Wout
10/9/2017 12:38 PM
|
---|
So you need to transform back? You can do that by using the inverse of the projection matrix: call method Matrix4D.GetInverse().
- Wout
|
pysaman
10/10/2017 7:46 PM
|
---|
OK.The problem is somewhat solved. But this gives a two-dimensional coordinate. Is there a way to get 3D coordinates. Given that I have a transfer matrix.
|
Wout
10/10/2017 7:52 PM
|
---|
You can feed a 3D point (x, y, 0) into the Transform method, and you'll get out a 3D point, but the original 0 z-coordinate is pretty much arbitrary.
- Wout
|
pysaman
10/11/2017 5:22 AM
|
---|
I dumped the DXF file into a DxfModel object, and my map has no path Over each other.
That is, each two-dimensional coordinate has only one z. Is it not possible to read Z coordinates inside the model, given that we have two-dimensional coordinates?
C# Code: DxfModel model = null; |
Wout
10/11/2017 8:18 AM
|
---|
I really don't understand your question. What do you mean by "read Z coordinates inside the model, given that we have two-dimensional coordinates?"
- Wout
|
pysaman
10/15/2017 8:59 PM
|
---|
I'm sorry. The basic idea is that we want to work with a DXF file in WPF. Since CadLib does not work with WPF 3D, we have to use other tricks. One way was to turn the DXF file into XAML and work with xaml Pathes. But the problem is that we only have two-dimensional coordinates, while in addition to X and Y, we need to Z. The whole thing we need to Z is when the mouse is along the paths, we show the three-dimensional coordinates of that point . Is there no other way?
|