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

Postby pravin_moule » Wed Mar 26, 2014 8:59 am

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

Re: Measure Radius

Postby jmaustpc » Wed Mar 26, 2014 10:19 am

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

Jim
wmayer
Site Admin
Posts: 15237
Joined: Thu Feb 19, 2009 10:32 am

Re: Measure Radius

Postby wmayer » Wed Mar 26, 2014 10:38 am

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

Re: Measure Radius

Postby jmaustpc » Wed Mar 26, 2014 12:51 pm

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

Postby pravin_moule » Fri Mar 28, 2014 7:05 am

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

Re: Measure Radius

Postby pravin_moule » Sun Mar 30, 2014 7:46 am

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

Re: Measure Radius

Postby wmayer » Sun Mar 30, 2014 9:06 am

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

Re: Measure Radius

Postby jmaustpc » Sun Mar 30, 2014 9:55 am

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

Re: Measure Radius

Postby wmayer » Sun Mar 30, 2014 10:38 am

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

Re: Measure Radius

Postby jmaustpc » Sun Mar 30, 2014 12:36 pm

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