origin changed after a cut from a utilility to sweep

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
YCStone_
Posts: 26
Joined: Fri May 06, 2016 3:10 am
Location: Xiamen - CHINA
Contact:

origin changed after a cut from a utilility to sweep

Postby YCStone_ » Mon Jun 27, 2016 12:02 pm

hi,
i just want to report why the origin point changed after created a utility to sweep, and then cut that portion:
sample file pls find below:
originChanged.fcstd
(21.61 KiB) Downloaded 15 times
AS you can see in the file, i exaggerated an origin point of a box NOT in the origin of 0,0,0,
then i make a utility sweep, then boolean deduct the two part, now i have a part where the origin has been reset to 0,0,0, which is not want i want - actually it is ok if it consistent. why because, im goint to use this part to be assembled in another file. If the origin point is not the same, i could not align them.
You see, resulted origin point becomes 0,0,0 but in reality it is not, when i tried to assemble it using Shape.Boundary.getPoint() to another file, the points that i have is not 0,0,0 origin but the previous origin where it was exagerated.

i just want to ask help, how do i keep track of the original origin point???
is there a utility to find this?

thanks so much
YC Stone Natural Stone Supplier
User avatar
YCStone_
Posts: 26
Joined: Fri May 06, 2016 3:10 am
Location: Xiamen - CHINA
Contact:

Re: origin changed after a cut from a utilility to sweep

Postby YCStone_ » Mon Jun 27, 2016 12:03 pm

my freecad settings below:
OS: Ubuntu 15.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6703 (Git)
Build type: None
Branch: releases/FreeCAD-0-16
Hash: 2ce5c8d2e3020d05005ed71f710e09e9aa561f40
Python version: 2.7.10
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
YC Stone Natural Stone Supplier
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: origin changed after a cut from a utilility to sweep

Postby DeepSOIC » Mon Jun 27, 2016 12:28 pm

Hi!
Am I correct with understanding what you complain about:
* Placement of Clone of Box is nonzero
* you expected Placement of Cut to be nonzero, but it is zero

This is by design. There are quite a lot of people complaining it makes it hard (almost impossible) to move parts as a whole, together with their original shapes. This is being addressed in development version v0.17, where Part and Body containers were introduced to do this kind of business.
User avatar
YCStone_
Posts: 26
Joined: Fri May 06, 2016 3:10 am
Location: Xiamen - CHINA
Contact:

Re: origin changed after a cut from a utilility to sweep

Postby YCStone_ » Tue Jun 28, 2016 1:34 am

DeepSOIC wrote:Hi!
Am I correct with understanding what you complain about:
* Placement of Clone of Box is nonzero
* you expected Placement of Cut to be nonzero, but it is zero

This is by design. There are quite a lot of people complaining it makes it hard (almost impossible) to move parts as a whole, together with their original shapes. This is being addressed in development version v0.17, where Part and Body containers were introduced to do this kind of business.

Hi DeepSoic,

yes that is exactly what i got, i got a nonzero origin but it becomes a zero after the sweep cut. it is OK if the origin changed, but it should be consistent, for example, i transfer the sweep cut part to another file for assembly, the script for the assembly uses the origin point, i get way off the mark after the assembly. as temporary fix, i tried to make the part before the sweep cut to zero-origin, then make the sweep cut. Now i copied this part to another file for assembly, the script for automatic assembly works fine now. note that the script for assembly works something like this:
if '03' in obj[0].Name:
if len(obj)==3:
v1o=obj[0].Shape.BoundBox.getPoint(4) #_03 backcurve
v1e=obj[0].Shape.BoundBox.getPoint(2) #_03
v2o=obj[1].Shape.BoundBox.getPoint(4) #_02l
v2e=obj[1].Shape.BoundBox.getPoint(2) #_02l
v3o=obj[2].Shape.BoundBox.getPoint(4) #_01
v3e=obj[2].Shape.BoundBox.getPoint(2) #_01
v3xl=v3e.x-v3o.x
v1xl=v1e.x-v1o.x
x_dev=(v3xl-v1xl)/2
x=[ v3o.x+x_dev ][0] # gardener is base
y=[ v2e.y-v1e.y ][0]
if v1e.z<>v2e.z:
temp=v1e.z-v2e.z
if v1e.z>v2e.z:
z=[ v1o.z-temp ][0]
if v1e.z<v2e.z:
z=[ v1o.z-temp ][0]
else: z=v1o.z
return x,y,z
the function return x,y,z which is the new placement point of the part. it is still crude. i only need two points (4) front-left-down point, and (2) back-right-up point, to get the part where it is then have the script assemble all the parts. it would be nice if the origin point inconsistency would be solved.
i would like to understand this another way, at first when the part is non-zero origin, its coordinate system is global. After the sweep cut into the part, the origin of part becomes zero, so it means its coordinate system becomes local to the part only. i copy this part to another file, where all it properties have been transferred also, so the local coordinate becomes the global coordinate, but the problem, although the origin coordinate of this part is 0,0,0 it is not actually zero but positioned in the original coordinate before the sweep cut, so it means i got 0,0,0 coordinate but actually it is not. it would be fine if i can call the original coordinate points..Is there a way to call the original coordinate other than call getPoint()????

i havent had a time to compile on my own the freecad, though im using linux, but because its too involved, in the future i think i will. if this somewhat improve in 0.17 i am looking forward for it.
cheers!
YC Stone Natural Stone Supplier
User avatar
YCStone_
Posts: 26
Joined: Fri May 06, 2016 3:10 am
Location: Xiamen - CHINA
Contact:

Re: origin changed after a cut from a utilility to sweep

Postby YCStone_ » Tue Jun 28, 2016 1:37 am

sorry the code above is unrecognizable wo the indent, here again

Code: Select all

    
    if '03' in obj[0].Name:
        if len(obj)==3:
            v1o=obj[0].Shape.BoundBox.getPoint(4) #_03 backcurve
            v1e=obj[0].Shape.BoundBox.getPoint(2) #_03
            v2o=obj[1].Shape.BoundBox.getPoint(4) #_02l
            v2e=obj[1].Shape.BoundBox.getPoint(2) #_02l
            v3o=obj[2].Shape.BoundBox.getPoint(4) #_01
            v3e=obj[2].Shape.BoundBox.getPoint(2) #_01
            v3xl=v3e.x-v3o.x
            v1xl=v1e.x-v1o.x
            x_dev=(v3xl-v1xl)/2
            x=[ v3o.x+x_dev ][0] # gardener is base
            y=[ v2e.y-v1e.y ][0]
            if v1e.z<>v2e.z:
                temp=v1e.z-v2e.z
                if v1e.z>v2e.z:
                    z=[ v1o.z-temp  ][0]
                if v1e.z<v2e.z:
                    z=[ v1o.z-temp ][0]
            else: z=v1o.z
            return x,y,z
YC Stone Natural Stone Supplier