CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 13, 2018, 22:30:41 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Transforming PolyRectangles  (Read 254 times)
GeoffreyGRoy
Storm Trooper
***
Offline Offline

Posts: 151


View Profile
« on: November 01, 2018, 09:19:52 am »

I know this, or a similar, bug has been previously reported some time ago in  http://www.cambam.co.uk/forum/index.php?topic=1955.msg11437#msg11437, but the bug still seems to be around. 

My task involves:
(1) creating a number of Polyrectangles
(2) rotating each of them using Transform-> Rotate using the mouse, then
(3) transforming all of them (together) using the Transformation matrix

The results are shown in the attachment.  Basically the application of the Transformation matrix does not give the correct result if more that one Polyrectangle is to be Transformed.

If I first convert the Polyrectagles to Polylines, then it all works.

The first test is with a single Polyrectangle (OK), then with two (not OK), then after conversion to Polylines (OK)

Geoff

* TransformPR.pdf (402.1 KB - downloaded 5 times.)
Logged
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #1 on: November 01, 2018, 14:33:12 pm »

In the past I've been told to tranform all the object in polylines before  applying the transformation matrix.

I guess because the transformation matrix work on polylines only.

As a side note internaly the polyrectangles XML part hold the polyline of the shape.

Code:
<rect id="4" Closed="true" p="137,67,0" w="52" h="21" radius="2">
          <ModificationCount>51</ModificationCount>
          <Tag>With corner radius</Tag>
          <mat m="Identity" />
          <pts>
            <p>139,67,0</p>
            <p b="0.41421356237309503">187,67,0</p>
            <p>189,69,0</p>
            <p b="0.41421356237309503">189,86,0</p>
            <p>187,88,0</p>
            <p b="0.41421356237309503">139,88,0</p>
            <p>137,86,0</p>
            <p b="0.41421356237309503">137,69,0</p>
          </pts>
        </rect>


Regards

Carlo D.
Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3654



View Profile
« Reply #2 on: November 01, 2018, 15:00:31 pm »

I'm sure it's due to their properties, i.e. it has a point for 'lower left' then 'width' and 'height' so it looks like the transformation just uses those.
Logged
GeoffreyGRoy
Storm Trooper
***
Offline Offline

Posts: 151


View Profile
« Reply #3 on: November 03, 2018, 07:47:57 am »

It seems that a single Polyrectangle transforms correctly, but  if two, or more, are selected together the problem appears.

Geoff
Logged
onekk
Wookie
****
Offline Offline

Posts: 390


View Profile
« Reply #4 on: November 04, 2018, 11:26:02 am »

What the problem is?

From the image it seems that the sides are not drawn correctly and somewhat "staircased", maybe the transformation is a "scaling" and internally the routine has some bug, but the fact that with one polyrectangle is working and with many polyrectangles is not it seems strange.

The problem appear to all the "entities", or maybe only to the "last selected" entity.

Maybe i go wrong but a the apply transformation "routine" has to scan the selection and apply the same transformation to all the entities, maybe a problem in the "last selected" entity could reveal a bad code in some "loop".

The problem appear only on PolyRectangles or maybe even in mixed objects like Circles (that are not Polylines).

Regards

Carlo D.

Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.111 seconds with 19 queries.

Copyright © 2018 HexRay Ltd. | Sitemap