circleFrom1tan2pt help?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
spacether
Posts: 12
Joined: Fri Dec 27, 2013 7:11 pm
Contact:

circleFrom1tan2pt help?

Post by spacether »

Does anyone know how to mace a circle with:
DraftGeomUtils.circleFrom1tan2pt ?

The python help doesn't indicate type or units:
circleFrom1tan2pt(tan1, p1, p2)

Is tan1 a line or point or angle? Degrees or radians? Is it referring to the angle at p1 or p2?
Are p1 and p2 supposed to be vectors?
I've tried:
line, vector, vector
angle rad, vector, vector
angle deg, vector, vector
All to no avail.

The command fails with no error messages.
Thank you much.
User avatar
wandererfan
Veteran
Posts: 6321
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: circleFrom1tan2pt help?

Post by wandererfan »

I've never used it, but the source is:

Code: Select all

def circleFrom1tan2pt(tan1, p1, p2):
    if (geomType(tan1) == "Line") and isinstance(p1, FreeCAD.Vector) and isinstance(p2, FreeCAD.Vector):
        return circlefrom1Line2Points(tan1, p1, p2)
I'd guess (edge,vector,vector).

wf
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: circleFrom1tan2pt help?

Post by jmaustpc »

wandererfan wrote:I've never used it, but the source is:

Code: Select all

def circleFrom1tan2pt(tan1, p1, p2):
    if (geomType(tan1) == "Line") and isinstance(p1, FreeCAD.Vector) and isinstance(p2, FreeCAD.Vector):
        return circlefrom1Line2Points(tan1, p1, p2)
I'd guess (edge,vector,vector).

wf
Since it says "geomType" I was wondering if there any chance that its wanting Lines and points rather than Edges and vertices?

Jim
User avatar
wandererfan
Veteran
Posts: 6321
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: circleFrom1tan2pt help?

Post by wandererfan »

jmaustpc wrote:Since it says "geomType" I was wondering if there any chance that its wanting Lines and points rather than Edges and vertices?
Don't think so. It doesn't like Draft Features.

>>> l = App.ActiveDocument.Line
>>> p = App.ActiveDocument.Point
>>> p1 = App.ActiveDocument.Point001
>>> x = DraftGeomUtils.circleFrom1tan2pt(l,p,p1)
>>> print x
None
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: circleFrom1tan2pt help?

Post by yorik »

All those circle functions at the end of DraftGeomUtils were half-implemented a long time ago by a guy who never totally finished the job... so i'm afraid several are not functionning properly
Post Reply