Measure Radius

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!
pravin_moule
Posts: 3
Joined: Wed Mar 26, 2014 8:55 am

Measure Radius

Post by pravin_moule »

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
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Measure Radius

Post by jmaustpc »

Please post your help ...about FreeCAD.... data, as there are many variations to this question.

Jim
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Measure Radius

Post by wmayer »

What you can do is to select a circle or an arc and run this code snippet:

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
How to view cross section of igs or stp data
What exactly do you mean?
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.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Measure Radius

Post by jmaustpc »

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.
pravin_moule
Posts: 3
Joined: Wed Mar 26, 2014 8:55 am

Re: Measure Radius

Post by pravin_moule »

Thanks
pravin_moule
Posts: 3
Joined: Wed Mar 26, 2014 8:55 am

Re: Measure Radius

Post by pravin_moule »

There are two circles/point placed diagonally then how to measure distance between these circles center point horizontally/vertically
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Measure Radius

Post by wmayer »

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))
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Measure Radius

Post by jmaustpc »

Do you mean that you want to know how to do it with a GUI tool or in a script?
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Measure Radius

Post by wmayer »

I don't think with the GUI it's already doable.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Measure Radius

Post by jmaustpc »

wmayer wrote:I don't think with the GUI it's already doable.
Hi Werner
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
Post Reply