Transforming arc, line, circle, point

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
flycast
Posts: 5
Joined: 15 Sep 2013, 03:05

Transforming arc, line, circle, point

Post by flycast » 12 Oct 2013, 22:56

I am evaluating CADImport to import and use geometries in a DXF or DWG file. As part of what I am doing I need to both transform the entities CADArc, CADLine CADPoint and CADLine and rotate them a around a point (usually 0,0).

I am working on rotating an arc and am using the following code:

Code: Select all

        Select Case _entityType
            Case CADImport.EntityType.Arc
                Dim arc As New CADArc
                arc = _entity
                arc.StartAngle = arc.StartAngle + degrees
                arc.EndAngle = arc.EndAngle + degrees
                _entity = arc
        End Select
When I do this it changes the start angle, end angle but the Box property does not change. The box property still reflects the old values before the transform.

How would I rotate and transform all four entities properly?

Also, I looked into CADConverter.iterate but that was very unclear in the documentation. I see that it uses a delegate. It looks to me like you still have to write a sub that does the rotate of transform. I seem to be back where I started...how to rotate or transform?

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Transforming arc, line, circle, point

Post by support » 15 Oct 2013, 11:58

Hello!

The Box property is changed after calling CADConverter.Loads method. For example:

Code: Select all

img.Converter.Loads(arc)
What transformations do you need to perform except for rotation?


Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

flycast
Posts: 5
Joined: 15 Sep 2013, 03:05

Re: Transforming arc, line, circle, point

Post by flycast » 15 Oct 2013, 18:21

I am evaluating CADImport for importing DXF files and then manipulating the entities for use on a robot that does not use G-code.

So far, I know for sure that I need to do these things with the following entities:

Line
Polyline
Point
Circle
Arc

1) Rotate the entity around a point - usually the origin
2) Move/transform/shift an entity in x/y space by a value ie. 20 units in the x direction and 20 units in the y direction
3) Mirror the entity in 2d space around the x axis or y axis
4) Change the "direction" of an entity. That is, reverse the start and end point of an entity (where applicable, lines, arcs, polylines). Obviously this is nit just a matter of reversing the start and end points but each entity will have it's own procedure.
5) Evaluate if the entity will be within the robot work envelope after the transformations/rotations, etc.

Sometimes I will need to do this on a single entity, sometimes I need to do this as an iteration with all entities.

Post Reply