Stretch in 3D

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
chrisb
Veteran
Posts: 53928
Joined: Tue Mar 17, 2015 9:14 am

Re: Stretch in 3D

Post by chrisb »

easyw-fc wrote:here the files in a single zipped

s3d.zip
The file is not available, could you please edit your last post? I wonder what's in this s3d.py.

I can't get the X, Y, Z, fields editable, only the distance.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
easyw-fc
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Stretch in 3D

Post by easyw-fc »

chrisb wrote: The file is not available, could you please edit your last post? I wonder what's in this s3d.py.
it is strange, I can download the file also when not logged...
anyway I have put the code in the post
with s3d.py you can assign the macro to a toolbar ...
chrisb wrote: I can't get the X, Y, Z, fields editable, only the distance.
me too

Maurice
chrisb
Veteran
Posts: 53928
Joined: Tue Mar 17, 2015 9:14 am

Re: Stretch in 3D

Post by chrisb »

Meanwhile I could download your files - strange.
I realized that you translated the chinese comments and you see me in awe.
However, I removed the setEnabled(False)-statements, I even tried to enter fixed values - all to no avail. I am still getting loads of error mesages, too many for me to enjoy continuing yet.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
jrdrukin
Posts: 33
Joined: Fri Nov 23, 2018 7:01 pm
Location: Hawthorne CA
Contact:

Re: Stretch in 3D

Post by jrdrukin »

.
Hello and Happy New Year <eason> :)

Your work on the 3D stretch tool is very intriguing.

I am wondering if you have made any further progress with it?

Perhaps this may be a difficulty if the reference is correct:
https://acronyms.thefreedictionary.com/GSCAD

Appears to be a proprietary file from Dassault Systemes???
Maybe some code from Catia or Solidorks???

Best wishes for safe, happy and prosperous new year.

Jerry/jrdrukin
thotbuilds
Posts: 2
Joined: Tue Oct 06, 2020 7:23 am

Re: Stretch in 3D

Post by thotbuilds »

Hi Guys,
My first post here! Freecad has been the best thing for about a month now! Been using if for BIM project. Migrated from sketchup so really missing the steretch and push pull tools :lol: So i am a FreeCAD noob :D Any updates on this tool ? Has it been integrated somewhere ? I am using the following version on FC. Google this but could not find any answers

OS: Zorin OS 15.3 (zorin:GNOME/zorin)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22756 (Git) AppImage
Build type: Release
Branch: master
Hash: ce87f586ee36ffe8ebcdcd3947ced4ab389ae795
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/India (en_IN)
chrisb
Veteran
Posts: 53928
Joined: Tue Mar 17, 2015 9:14 am

Re: Stretch in 3D

Post by chrisb »

thotbuilds wrote: Fri Oct 30, 2020 8:59 am Any updates on this tool ? Has it been integrated somewhere ?
I haven't heard of anything new, the author never responded.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Stretch in 3D

Post by Kunda1 »

eason wrote: Fri Nov 13, 2015 6:02 am :bell:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Stretch in 3D

Post by johnwang »

I use Part, throw in a cube object, then switch to Draft. Change to view x-y plane.

Saved version 1 as a py file. At the end, I added:

Code: Select all

showup()


Then run the py file in the python console. There are a few errors.

1. Could I change this:

Code: Select all

                            if cutobj.InList <> []:  # get group
to:

Code: Select all

                            if cutobj.InList >0:  # get group
2. Commented out #import DraftTrackers

3. Could I change this:

Code: Select all

        widget1.setWindowTitle(QtGui.QApplication.translate("Form", "3D Stretch", None,QtGui.QApplication.UnicodeUTF8))
to:

Code: Select all

        widget1.setWindowTitle(QtGui.QApplication.translate("Form", "3D Stretch", None))
I think this written in QT4. Need a QT5 version.

After these changes, I got the window up. Trying to figure out the next step.
v1.jpg
v1.jpg (84.11 KiB) Viewed 1497 times
Last edited by johnwang on Sun Nov 01, 2020 10:26 am, edited 2 times in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Stretch in 3D

Post by johnwang »

Next step:
1. Click two points to form the red rectangle. (It should be in x-y plane.)
2. Click two points to draw the blue line to define distance and direction.

Then FC crashed.

I think the program is to use the red rectangle to cut the cube object into two parts. Then move one part according to the blue line. Then generate new part from the cut plane. Then fuse all parts together as one single new part.
Last edited by johnwang on Sun Nov 01, 2020 11:12 am, edited 1 time in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Stretch in 3D

Post by johnwang »

Stretched!

Code: Select all

22:01:16  
please pick 1 point!Picked first point. Please pick second point.
22:01:18  Please pick the second point.
22:01:23  Picked 2 points.
22:01:23  Cutting object...
22:01:23  
p1 = FreeCAD.Vector(-1.6510096788406372,6.496427059173584,0.0)
22:01:23  
p2 = FreeCAD.Vector(-1.6510096788406372,11.250450134277344,0.0)
22:01:23  
p3 = FreeCAD.Vector(11.400130271911621,11.250450134277344,0.0)
22:01:23  
p4 = FreeCAD.Vector(11.400130271911621,6.496427059173584,0.0)
22:01:23  
Object i:Box  Shape 1  =>  0
Object i:Box  Shape 2  =>  0
Object i:Box  Shape 3  =>  0
Object i:Box  Shape 4  =>  0
Object i:Box  Shape 5  =>  0
Object i:Box  Shape 6  =>  1
objName:Box
22:01:23  
NO~~~group  id
22:01:23  []
22:01:23  
Transparency
22:01:23  
scolar:(0.800000011920929, 0.800000011920929, 0.800000011920929, 0.0)
22:01:23  
lcolar:(0.09803921729326248, 0.09803921729326248, 0.09803921729326248, 0.0)
22:01:23  
pcolar:(0.09803921729326248, 0.09803921729326248, 0.09803921729326248, 0.0)
22:01:23  
mygroup:[]
22:01:23  
name:Cube
22:01:23  
Area NOT SAME . . . !  
22:01:23  ----------------
22:01:23  Downgrade objects
22:01:23  Found 1 multi-solids compound: exploding it
22:01:23  
DOW:([<Part::PartFeature>, <Part::PartFeature>], [])
22:01:23  
common der Face:
22:01:23  
NO MOVE
22:01:23  
common der Face::1
22:01:23  
MOVE
22:01:23  
del objbase:Temp
22:01:23  
EXT.Name:Extrude
22:01:23  
C_CM:[[<Part::PartFeature>]]
22:01:23  
C_NM:[[<Part::PartFeature>]]
22:01:23  
LCD_CM:[[<Part::PartFeature>]]
22:01:23  
SSCM:[<Part::PartFeature>]
22:01:23  Object cutted.
22:01:23  
22:01:23  
22:01:23  
22:01:23  Please pick two points to define the move distance and direction.
22:01:23  
22:01:27  Third point picked. Please pick the fourth point.
22:01:30  
cd:Vector (0.2690954213158132, 3.9467369388175424, 0.0)
22:01:30  Move distance and direction defined. Please click Move button to stretch.
22:01:34  
GOGOGO
22:01:34  
ONMIDOBJ:[]
22:01:34  
FACELIST:[[<Part::PartFeature>, <Face object at 000001E8D4B5A920>, [<Face object at 000001E8DA7C0670>], 0, (0.800000011920929, 0.800000011920929, 0.800000011920929, 0.0), (0.09803921729326248, 0.09803921729326248, 0.09803921729326248, 0.0), (0.09803921729326248, 0.09803921729326248, 0.09803921729326248, 0.0), [], 'Cube', [], []]]
22:01:34  
MOV:Vector (0.06802560372540664, 0.9976835757081471, 0.0)
22:01:34  
stretch
22:01:34  
DELLIST:['Fusion', 'Temp', 'Extrude', 'Solid', 'Solid001']
22:01:34  
DELII:['Box']
22:01:34  
Stretch  quit...!
close self.c
22:01:34  
0
22:01:34  
press ESC ... visibility => True
22:01:34  
ii:[<Part::PartFeature>, <Face object at 000001E8D4B5A920>, [<Face object at 000001E8DA7C0670>], 0, (0.800000011920929, 0.800000011920929, 0.800000011920929, 0.0), (0.09803921729326248, 0.09803921729326248, 0.09803921729326248, 0.0), (0.09803921729326248, 0.09803921729326248, 0.09803921729326248, 0.0), [], 'Cube', [], []]
22:01:34  
DELERROR
s3d2.jpg
s3d2.jpg (8.39 KiB) Viewed 1411 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
Post Reply