Measure Radius
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 3
- Joined: Wed Mar 26, 2014 8:55 am
Measure Radius
1) How can I meaure radius of circle or arc if I opened igs or stp data
2) How to view cross section of igs or stp data
2) How to view cross section of igs or stp data
Re: Measure Radius
Please post your help ...about FreeCAD.... data, as there are many variations to this question.
Jim
Jim
Re: Measure Radius
What you can do is to select a circle or an arc and run this code snippet:
If you want to see internals of a solid you can use the clipping plane from the View menu.
If you want to slice your shape into pieces there is a cross-section command in the Part workbench.
Code: Select all
import Part
s=Gui.Selection.getSelectionEx()[0]
e=s.SubObjects[0]
if issubclass(type(e),Part.Edge):
if issubclass(type(e.Curve),Part.Circle):
print e.Curve.Radius
elif issubclass(type(e.Curve),Part.ArcOfCircle):
print e.Curve.Radius
What exactly do you mean?How to view cross section of igs or stp data
If you want to see internals of a solid you can use the clipping plane from the View menu.
If you want to slice your shape into pieces there is a cross-section command in the Part workbench.
Re: Measure Radius
For measuring a circle....depending on your version data...I was going to suggest you try using a parametric/linked Draft dimension as it will give to the diameter of a circle, ...if you don't want to keep the Draft Dimension after you have read it the just delete it. There are also other tricks like using a Draft Line with various snapping options.
If you have a recent enough version there are also now a limited range of measuring tools.
If you have a recent enough version there are also now a limited range of measuring tools.
-
- Posts: 3
- Joined: Wed Mar 26, 2014 8:55 am
Re: Measure Radius
Thanks
-
- Posts: 3
- Joined: Wed Mar 26, 2014 8:55 am
Re: Measure Radius
There are two circles/point placed diagonally then how to measure distance between these circles center point horizontally/vertically
Re: Measure Radius
Code: Select all
import Part, math
def getPoint(e):
if issubclass(type(e),Part.Edge):
if issubclass(type(e.Curve),Part.Circle):
return e.Curve.Center
elif issubclass(type(e.Curve),Part.ArcOfCircle):
return e.Curve.Center
else:
raise Exception("Edge is not an arc or circle")
elif issubclass(type(e),Part.Vertex):
return e.Point
else:
raise Exception("Neither edge nor vertex selected")
selection = Gui.Selection.getSelectionEx()
if len(selection) >= 2:
e1 = selection[0].SubObjects[0]
e2 = selection[1].SubObjects[0]
elif len(selection) == 1:
e1 = selection[0].SubObjects[0]
e2 = selection[0].SubObjects[1]
else:
raise Exception("Wrong selection")
p1=getPoint(e1)
p2=getPoint(e2)
print ("Euclidian distance: %f") % (p1.distanceToPoint(p2))
print ("Delta x: %f") % (math.fabs(p1.x-p2.x))
print ("Delta y: %f") % (math.fabs(p1.y-p2.y))
print ("Delta z: %f") % (math.fabs(p1.z-p2.z))
Re: Measure Radius
Do you mean that you want to know how to do it with a GUI tool or in a script?
Re: Measure Radius
I don't think with the GUI it's already doable.
Re: Measure Radius
Hi Wernerwmayer wrote:I don't think with the GUI it's already doable.
it is if you use Draft dimensions, it works a bit differently in different versions ....but in the latest master on Linux it works well.
I just did this, Draft Dimension, snap set to centre, other snaps off, then use the constrain button (shift) and it makes a either horizontal or vertical Draft dimension from centre to centre of two curves (arcs or circles). It worked on some STEP files I experimented with, and Part Circles and Draft circles, and the end of a Part Cylinder. Also I should add that we now have snap to plane.
Jim