Author Topic: Re-size moves the polyline??  (Read 381 times)

Offline JG

  • Droid
  • **
  • Posts: 81
    • View Profile
Re-size moves the polyline??
« on: September 15, 2020, 18:13:01 pm »
Having opened a .DXF file drawn in and exported from CorelDRAW!, I found that I need to make a circle a little smaller - down from 14mm to 13.8mm. That doesn't present much of a problem but I find that the object doesn't remain in the same place on the grid  -   more important, I can't find any setting that says "keep object at the same centre position" or word to that effect.

Two screen-shots attached showing a before and after re-size.  It doesn't even look as though the movement is consistent on X and Y axes but since I have yet to find any information giving me the position of any object on the grid I can't be sure.

Surely it ought to be possible to simply re-size any object (particularly a circle) keeping the centre where it has been drawn.

In case you are wondering, I have looked at [Align] as well but setting that to 'Centre' just aligns the selected objects in the centre of the grid - not with each other  ??? ::)


Offline airnocker

  • Wookie
  • ****
  • Posts: 454
    • View Profile
Re: Re-size moves the polyline??
« Reply #1 on: September 15, 2020, 18:58:59 pm »
My initial guess is that the imported primitive object (your circules) imported as "polylines" and not as "circles".  The CamBam "circle" primitive has center coordinates that remain unchanged when scaling the object, whereas "polyline" primitive objects do not.  I know in CB you can convert a "circle" to a "polyline" or "Region" but I don't see that a circular "Polyline" can be converted to a "circle".

I'm sure our experts may know a cure for your problem.
airnocker

Everything depends on everything else

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8331
    • View Profile
Re: Re-size moves the polyline??
« Reply #2 on: September 15, 2020, 19:52:09 pm »
Even with a circular polyline, you can establish a 'center point', although you have to do that manually.

Mark the center point AFTER enlarging it.  Then mark the center point of the circular line with which you wish it to align.

Select both the enlarged circular polyline AND it's established center, and just move it to the same point marked by the smaller circle's center.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: Re-size moves the polyline??
« Reply #3 on: September 15, 2020, 20:12:25 pm »
Hello

Resize use always the center of the axis cross as transformation center.

Quote
In case you are wondering, I have looked at [Align] as well but setting that to 'Centre' just aligns the selected objects in the centre of the grid - not with each other

Try this plugin ;)

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Aligner.html

++
David

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1777
    • View Profile
    • pixelmaker
Re: Re-size moves the polyline??
« Reply #4 on: September 15, 2020, 20:26:38 pm »
If you make mistakes in your file it is not useful to solve them in CamBam.
A line has a width. In Corel Draw you can set the outline position. There are 3 different settings that determine in which direction a contour extends.
Outline outside,
outline centered and
outline inside.
The size of an object in Corel is unfortunately always measured over all, i.e. diameter of a circle including line width. With DXF export, however, the centre of the outline is exported without line width. If I create a circle with a diameter of 100mm and an outline thickness of 0.2mm and the setting Outline centred, the diameter exported in DXF is only 99.8mm.
If I use the outline inside setting, the outer diameter remains the same after the export.
So all lines must be created with the setting Outline inside or with a line width of 0.

ralf


Offline JG

  • Droid
  • **
  • Posts: 81
    • View Profile
Re: Re-size moves the polyline??
« Reply #6 on: September 16, 2020, 00:22:19 am »
Thanks all --- reading through the replies I began to think that it may well be quicker and easier to go back to the CorelDRAW! file and change the size there before re-exporting to a new .DXF file!!

I did eventually copy and paste the Python script but thought that re-sizing by a [Scale] wouldn't be good enough. It turns out that I was correct and it took me five attempts and I had to resort to 7 decimal places for the scale to get the correct figure :(    Even so, the worst error (1st attempt) was only 0.00006 mm out so I doubt that I need concern myself too much on that score  ;D

When I [Opened] the script I noticed that there was another already in the scripts folder - it didn't complain when I saved my version because I'd added in the underlined spaces but it is the same script so is obviously automatically included during a current installation.

Though I know of Python, I have never looked at it -- and I'm wary of anything which is effectively a 'Black Box' -- but it does the job.

Another good day of learning the potential pitfalls of my work-flow - not that I think changing it will be beneficial, I just need to keep the limitations/foibles in mind.

The detailed explanation about CorelDRAW! .DXF export by pixelmaker is very useful - I hadn't considered the line-width would have any bearing upon the size exported, I'd assumed that it would use the 'centre' of the line.   Hmmmm...... :-\


I've just done a test and fortunately I find that no matter what line width I set in CorelDRAW! the object opened in CamBam is exactly the size I expected. I use 'points' not mm as my line-width dimension incidentally -- and I can't find anywhere in CorelDRAW! that specifies 'inside', 'outside' or 'centre' for either the line width or export option.


Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2370
    • View Profile
Re: Re-size moves the polyline??
« Reply #7 on: September 16, 2020, 08:12:56 am »
It's much easier and faster to draw a native CB circle with center point and diameter and align it to the center of the circular polyline.

Offline JG

  • Droid
  • **
  • Posts: 81
    • View Profile
Re: Re-size moves the polyline??
« Reply #8 on: September 16, 2020, 09:28:54 am »
It's much easier and faster to draw a native CB circle with center point and diameter and align it to the center of the circular polyline.
I'll concur with that Dragonfly !!

I slept on the issue because I found that the polylines had 240 nodes and although I tried [Clean]  which I thought might reduce them back to the four which is all it takes to describe a circle - it did nothing that I could discern.

My drawing in CorelDRAW! uses only 4 nodes when converted to 'Curves' rather than a circle so I'm now considering whether it is the Export via the AutoCAD R13 process, or the CamBam Import filter which creates the nodes.  Exporting was done whilst the objects were circles rather than curves.

As a test this morning I created the drawing natively in CB using [Circles] which I did at the 0-0 position, which allowed resize without movement, and then used [Copy][Paste] and [Numerical Move] to reposition (there are four identical components). This produced a G-Code file with 370 lines using G3 Arcs compared to the Polyline version which is nearly 25000 lines using G1 throughout!

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1777
    • View Profile
    • pixelmaker
Re: Re-size moves the polyline??
« Reply #9 on: September 16, 2020, 10:32:59 am »
Quote
I use 'points' not mm as my line-width dimension incidentally
I don't know if a user who is not reading the manual is interested.
Corel calculates internally in inches. The smallest calculation unit in Corel is 1/1000 inch, every calculation is rounded.
I pt = 0.0138889 inch. Even with the internal calculation, there are differences that you have to expect if you want to have precise results. With every scaling or deformation the values are rounded.
Quote
and I can't find anywhere in CorelDRAW! that specifies 'inside', 'outside' or 'centre' for either the line width or export option.
Select an object.
Click -> Window  -> Dockers  -> Object properties.
Specify the outline position

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2370
    • View Profile
Re: Re-size moves the polyline??
« Reply #10 on: September 16, 2020, 10:37:07 am »
Quote
I found that the polylines had 240 nodes
If you do not forget to convert everything to curves in CorelDRAW before exporting do .DXF circles will appear in CamBam as splines with 4 nodes and after converting everything to polyline in CamBam they will be polylines with 4 nodes. If not converted to curves CorelDRAW filter exports them as shapes with numerous microscopic straight segments. Which not only puts unnecessary load on CamBam and computer CPU but hugely affects smooth machine movement when milling.

Offline JG

  • Droid
  • **
  • Posts: 81
    • View Profile
Re: Re-size moves the polyline??
« Reply #11 on: September 16, 2020, 12:38:45 pm »
Quote
I use 'points' not mm as my line-width dimension incidentally
I don't know if a user who is not reading the manual is interested.
I can appreciate your frustration Ralf but I may have read more CorelDRAW! manuals than most but having used it since version 0.9 the small changes incorporated with each new revision which seldom impinge upon the work that I tend to do tend to get lost in the grey matter.   Up to July my use of CorelDRAW! was only to create Graphic Images and general technical drawings rather than drawings intended for CNC Production.
Quote from: pixelmaker
Corel calculates internally in inches. The smallest calculation unit in Corel is 1/1000 inch, every calculation is rounded.
I pt = 0.0138889 inch. Even with the internal calculation, there are differences that you have to expect if you want to have precise results.
Just a small correction there - historically there are 72.27 points to the inch so the correct figure is 0.0138370" or 0.351459804mm. I know that Microsoft tried to insist that there were 100 points to the inch and were soundly corrected and some programs don't take the care that ought to be taken and use the 'estimate' of 72 to the inch (which is what you have specified).

Quote from: pixelmaker
With every scaling or deformation the values are rounded.
Quote
and I can't find anywhere in CorelDRAW! that specifies 'inside', 'outside' or 'centre' for either the line width or export option.
Select an object.
Click -> Window  -> Dockers  -> Object properties.
Specify the outline position
Not on my system  -   I'm using Version X5  -   I do have [Window][Dockers][Properties] and that window has 6 'Tabs' of which the second is the only one dealing with the 'line'.   It has 'Width', 'Color', 'Style', 'Behind Fill' & 'Scale with image' - all of which I am familiar with and it also has an [Advanced] button which takes you to the 'normal' [Outline Pen] attributes.

Notwithstanding that, the fact that the objects I exported and pulled into CB were both the same size even though the line width was 0.5pt and 3pt tells me that either the .DXF export takes no account of the line width (I suspect this to be the case) or your system is not the same as mine.

Your 'tip' that conversion to 'Curves' is the best way to work is very useful and I'm sure you have (or someone has)  mentioned it previously  --  I'll try to remember that in future :)


Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2370
    • View Profile
Re: Re-size moves the polyline??
« Reply #12 on: September 16, 2020, 13:57:13 pm »
CorelDRAW uses whole number internal arithmetic - the base unit being 1/10000 of a millimeter.
Outline (line width) in CD is always symmetric (central) along the curve.
CD is a vector illustration and layout program. CamBam is a CAM program with some CAD abilities.
CD is very useful for creating and manipulating shapes with high precision. One big plus is that when exporting it retains the closed shapes. DXF files from CAD programs usually need selecting and rejoining sometimes  a huge number of diconnected elements to get the closed shape needed for the CAM job. But nothing more than that for CAD/CAM application.
Only layers are exported and recognized by CamBam in .DXF. And that's more than enough IMHO if things are carefully planned.

Offline JG

  • Droid
  • **
  • Posts: 81
    • View Profile
Re: Re-size moves the polyline??
« Reply #13 on: September 17, 2020, 08:57:23 am »
CorelDRAW uses whole number internal arithmetic - the base unit being 1/10000 of a millimetre.
I haven't investigated the innermost workings of CorelDRAW! (other than what is available in the [Options] settings) and was surprised at pixelmaker's statement that it works internally to 0.001" ----  0.0001mm is a much more plausible figure but I have my [Dimension] tool set to 6 places and CD will allow up to 9 places. The same is true of the Angular Dim. Tool. Naturally I'm using Metric measure.  I do find however that the [Nudge], [ Move] & [Size] dimensions are limited to 0.001mm.

Quote from: Dragonfly
Outline (line width) in CD is always symmetric (central) along the curve.
That aligns with my experience.

Quote from: Dragonfly
CD is a vector illustration and layout program. CamBam is a CAM program with some CAD abilities.
CD is very useful for creating and manipulating shapes with high precision. One big plus is that when exporting it retains the closed shapes. DXF files from CAD programs usually need selecting and rejoining sometimes  a huge number of disconnected elements to get the closed shape needed for the CAM job. But nothing more than that for CAD/CAM application.
Only layers are exported and recognized by CamBam in .DXF. And that's more than enough IMHO if things are carefully planned.
Again this is what I've found in my very limited time using CD to create objects and CB to create G-Code.

I started using CorelDRAW! to create Posters & Theatre Programmes so I have a tendency to use and talk in terms of Graphic Design rather than CAD. Since - in a former life - I served my time as a Toolmaker I do have the technical knowledge to deal with the high precision expected from CAM as well.


Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2984
    • View Profile
Re: Re-size moves the polyline??
« Reply #14 on: September 17, 2020, 17:43:55 pm »
 Since - in a former life - I served my time as a Toolmaker
*****************************************
As retired toolmaker, let me suggest CB(CamBam) is more than enough to do design work. I always strive to do my 100 percent design work here in CB and 99.9 percent I'm successful. I would strongly suggest to start with CB and do some parts in Corel as a last resort. Good luck.
My 2ยข

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540