Best way to scale a part of a STEP file

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!
xbit
Posts: 134
Joined: Mon Sep 21, 2020 10:48 am

Best way to scale a part of a STEP file

Postby xbit » Wed Jan 13, 2021 1:25 pm

Hello guys.

I am not a graphics designer, and since i used the GUI, a certain time has elapsed.

I have been looking for ways to scale a part of a STEP file.

what is the best way to scale a part of the STEP file?
I mean without creating a clone. Replacing the original part with the scaled (no clone production)
drmacro
Posts: 2358
Joined: Sun Mar 02, 2014 4:35 pm

Re: Best way to scale a part of a STEP file

Postby drmacro » Wed Jan 13, 2021 1:46 pm

Umm...but, that IS the process of scaling a STEP model in FreeCAD...

You can set the Objects property of the clone to nothing and delete the original unscaled STEP geometry.

But, to what end? Curious...
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."

My beginners, written treatise: Learning FreeCAD
keithsloan52
Posts: 1576
Joined: Mon Feb 27, 2012 5:31 pm

Re: Best way to scale a part of a STEP file

Postby keithsloan52 » Wed Jan 13, 2021 3:18 pm

xbit wrote:
Wed Jan 13, 2021 1:25 pm
Hello guys.

I am not a graphics designer, and since i used the GUI, a certain time has elapsed.

I have been looking for ways to scale a part of a STEP file.

what is the best way to scale a part of the STEP file?
I mean without creating a clone. Replacing the original part with the scaled (no clone production)
Please could you supply the STEP file and some details to identify the part that you wish to scale.
Also is it scale in all directions or different scales on different axis.
xbit
Posts: 134
Joined: Mon Sep 21, 2020 10:48 am

Re: Best way to scale a part of a STEP file

Postby xbit » Wed Jan 13, 2021 4:38 pm

I want to scale this part here:
Screenshot from 2021-01-13 18-32-59.png
Screenshot from 2021-01-13 18-32-59.png (15.34 KiB) Viewed 301 times
But as you can see there is no option to "modify the original", in the Draft Scale tool
Screenshot from 2021-01-13 18-36-07.png
Screenshot from 2021-01-13 18-36-07.png (35.38 KiB) Viewed 301 times
I have the STEP file attached.

Thank you very much!
Attachments
Assembly_Test.step
(691.16 KiB) Downloaded 11 times
User avatar
thomas-neemann
Posts: 1968
Joined: Wed Jan 22, 2020 6:03 pm

Re: Best way to scale a part of a STEP file

Postby thomas-neemann » Wed Jan 13, 2021 5:25 pm

xbit wrote:
Wed Jan 13, 2021 1:25 pm
for me it works with scale
Bildschirmfoto_2021-01-13_18-21-18.png
Bildschirmfoto_2021-01-13_18-21-18.png (142.76 KiB) Viewed 275 times
if you want I can make a video of it


OS: Ubuntu 18.04.5 LTS (ubuntu:GNOME/xubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23578 (Git) AppImage
Build type: Release
Branch: master
Hash: 50c3cbf00579dc4941ca743c25720d016b0453ce
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
keithsloan52
Posts: 1576
Joined: Mon Feb 27, 2012 5:31 pm

Re: Best way to scale a part of a STEP file

Postby keithsloan52 » Wed Jan 13, 2021 8:12 pm

thomas-neemann wrote:
Wed Jan 13, 2021 5:25 pm
xbit wrote:
Wed Jan 13, 2021 1:25 pm
for me it works with scale

Bildschirmfoto_2021-01-13_18-21-18.png

if you want I can make a video of it


OS: Ubuntu 18.04.5 LTS (ubuntu:GNOME/xubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23578 (Git) AppImage
Build type: Release
Branch: master
Hash: 50c3cbf00579dc4941ca743c25720d016b0453ce
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
For me the Component1 Shape is immutable and I can only scale by making a Clone
User avatar
thomas-neemann
Posts: 1968
Joined: Wed Jan 22, 2020 6:03 pm

Re: Best way to scale a part of a STEP file

Postby thomas-neemann » Wed Jan 13, 2021 8:40 pm

keithsloan52 wrote:
Wed Jan 13, 2021 8:12 pm


When I tried to make a video of it, I saw that an error occurred after pressing the ok button.
if it is of any use to you, you can scale over mesh

phpBB [video]
keithsloan52
Posts: 1576
Joined: Mon Feb 27, 2012 5:31 pm

Re: Best way to scale a part of a STEP file

Postby keithsloan52 » Wed Jan 13, 2021 9:37 pm

Well FreeCAD objects are in general parametric, for example Cube has Length, Width. Cylinder has radius, height etc. So to me it does not make much sense just being able to Scale the Shape without changing the related parameters. Now with this and I suspect most Import STEP files the 'Objects' are Brep Shapes without parameters and I am not sure why they should be immutable as far as scaling is concerned.
Component1 has an Object Type of 'Part::Feature', printing out its details with print(dir(object)) gives

Code: Select all

['Content', 'Document', 'ExpressionEngine', 'FullName', 'ID', 'InList', 'InListRecursive', 'Label', 'Label2', 'MemSize', 'Module', 'MustExecute', 'Name', 'NoTouch', 'OldLabel', 'OutList', 'OutListRecursive', 'Parents', 'Placement', 'PropertiesList', 'Removing', 'Shape', 'State', 'TypeId', 'ViewObject', 'Visibility', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'addExtension', 'addObject', 'addObjects', 'addProperty', 'adjustRelativeLinks', 'dumpContent', 'dumpPropertyContent', 'enforceRecompute', 'evalExpression', 'getAllDerivedFrom', 'getDocumentationOfProperty', 'getEditorMode', 'getGlobalPlacement', 'getGroupOfProperty', 'getLinkedObject', 'getObject', 'getParentGeoFeatureGroup', 'getParentGroup', 'getPaths', 'getPathsByOutList', 'getPropertyByName', 'getPropertyNameOfGeometry', 'getPropertyOfGeometry', 'getPropertyStatus', 'getPropertyTouchList', 'getStatusString', 'getSubObject', 'getSubObjectList', 'getSubObjects', 'getTypeIdOfProperty', 'getTypeOfProperty', 'hasChildElement', 'hasExtension', 'hasObject', 'isDerivedFrom', 'isElementVisible', 'isValid', 'newObject', 'purgeTouched', 'recompute', 'removeObject', 'removeObjects', 'removeObjectsFromDocument', 'removeProperty', 'resolve', 'resolveSubElement', 'restoreContent', 'restorePropertyContent', 'setEditorMode', 'setElementVisible', 'setExpression', 'setObjects', 'setPropertyStatus', 'supportedProperties', 'touch']
and print(dir(object.Shape))

Code: Select all

['Area', 'BoundBox', 'CenterOfMass', 'CompSolids', 'Compounds', 'Content', 'Edges', 'Faces', 'Length', 'Mass', 'Matrix', 'MatrixOfInertia', 'MemSize', 'Module', 'Orientation', 'OuterShell', 'Placement', 'PrincipalProperties', 'ShapeType', 'Shells', 'Solids', 'StaticMoments', 'SubShapes', 'Tag', 'TypeId', 'Vertexes', 'Volume', 'Wires', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', 'ancestorsOfType', 'check', 'childShapes', 'cleaned', 'common', 'complement', 'copy', 'countElement', 'cut', 'defeaturing', 'distToShape', 'dumpContent', 'dumpToString', 'exportBinary', 'exportBrep', 'exportBrepToString', 'exportIges', 'exportStep', 'exportStl', 'extrude', 'findPlane', 'fix', 'fixTolerance', 'fuse', 'generalFuse', 'getAllDerivedFrom', 'getElement', 'getFacesFromSubelement', 'getMomentOfInertia', 'getRadiusOfGyration', 'getTolerance', 'globalTolerance', 'hashCode', 'importBinary', 'importBrep', 'importBrepFromString', 'inTolerance', 'isClosed', 'isCoplanar', 'isDerivedFrom', 'isEqual', 'isInfinite', 'isInside', 'isNull', 'isPartner', 'isSame', 'isValid', 'limitTolerance', 'makeChamfer', 'makeFillet', 'makeOffset2D', 'makeOffsetShape', 'makeParallelProjection', 'makePerspectiveProjection', 'makeShapeFromMesh', 'makeThickness', 'makeWires', 'mirror', 'multiFuse', 'nullify', 'offsetFaces', 'oldFuse', 'optimalBoundingBox', 'overTolerance', 'project', 'proximity', 'read', 'reflectLines', 'removeInternalWires', 'removeShape', 'removeSplitter', 'replaceShape', 'restoreContent', 'reverse', 'reversed', 'revolve', 'rotate', 'rotated', 'scale', 'scaled', 'section', 'sewShape', 'slice', 'slices', 'tessellate', 'toNurbs', 'transformGeometry', 'transformShape', 'transformed', 'translate', 'translated', 'writeInventor']
But calling the Shapes, scale function gives

Code: Select all

21:30:35  Running the Python command 'toScaleCommand' failed:
Traceback (most recent call last):
  File "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/toSketch/freecad/toSketch/toSCommands.py", line 151, in Activated
    sel.Shape.scale(2.0)

This object is immutable, you can not set any attribute or call a non const method
I can understand not being able to scale a Cube, Cylinder etc but not sure why a Brep Shape from a STEP import needs to be set to immutable, or why. a cloned shape is okay to scale.
xbit
Posts: 134
Joined: Mon Sep 21, 2020 10:48 am

Re: Best way to scale a part of a STEP file

Postby xbit » Thu Jan 14, 2021 2:50 pm

Thank you guys.

@thomas-neemann
Thank you for taking the time to produce that video.
But when you scaled the part, it kept only that part.
It did not included it that part (now scaled) in the original geometry.

@keithsloan52

You said this:
not sure why a Brep Shape from a STEP import needs to be set to immutable, or why. a cloned shape is okay to scale.
What i want to do is scale only a part of the step file.
What i deduce from what you said, is that it is pretty much impossible in FreeCAD. Is this correct?
User avatar
thomas-neemann
Posts: 1968
Joined: Wed Jan 22, 2020 6:03 pm

Re: Best way to scale a part of a STEP file

Postby thomas-neemann » Thu Jan 14, 2021 2:56 pm

xbit wrote:
Thu Jan 14, 2021 2:50 pm
I probably didn't quite understand the question.
can you tell me what the result should be?