Transforming arc, line, circle, point
Moderators: SDS, support, admin
Transforming arc, line, circle, point
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:
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?
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
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?
Re: Transforming arc, line, circle, point
Hello!
The Box property is changed after calling CADConverter.Loads method. For example:
What transformations do you need to perform except for rotation?
Mikhail.
The Box property is changed after calling CADConverter.Loads method. For example:
Code: Select all
img.Converter.Loads(arc)
Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Transforming arc, line, circle, point
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.
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.