1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Arc Length

Discussion in 'Using Alibre Design' started by Mika, Aug 3, 2018.

  1. Mika

    Mika Member

    Any possibility to measure arc length? Not only the edge, but maybe also the center-line of bent pipe...
     
  2. ajayre

    ajayre Alibre Super User

    Code:
    import math
    
    # get current part
    P = CurrentPart()
    # get a specific 2D sketch
    Sk = P.GetSketch("Sketch<1>")
    
    # look for all arcs in sketch
    for Fig in Sk.Figures:
    
      # found an arc
      if isinstance(Fig, CircularArc):
        StartPt = Fig.StartPoint
        EndPt = Fig.EndPoint
        CenterPt = Fig.Center
        Radius = Fig.Radius
    
        # calculate straight-line distance between start and end points
        D = math.sqrt(pow(StartPt[0] - EndPt[0], 2) + pow(StartPt[1] - EndPt[1], 2))
    
        # calculate distance along arc between start and end points
        Theta = math.acos(1 - ((D * D) / (2 * Radius * Radius)))
        Length = Radius * Theta
        print Length
    
    I haven't tested it if the arc covers more than 180 degrees. In that case you will probably have to subtract the result from the circle circumference or swap the start and end points around.

    https://math.stackexchange.com/questions/830413/calculating-the-arc-length-of-a-circle-segment

    Andy
     
  3. sz0k30

    sz0k30 Senior Member

    Andy,

    I am not questioning your formula, but responding to Mika's question.

    This is something I asked for a long time ago. Alibre is a computer. For most things it functions as a very smart computer. When I create a straight line, Alibre knows the start point, the end point and the length of the line. And yet when I create an arc, Alibre knows the start point, the end point and the radius. So IT KNOWS the arc length. Yet for arcs Alibre acts as a very dumb computer. If it knows the arc length, it should let me dimension the arc length, not keep it an internal secret.
     
    NateLiqGrav likes this.
  4. oldfox

    oldfox Alibre Super User

    Sounds like there's two separate issues in this thread:

    1. Measuring the length of an arc
    2. Drawing an arc to a desired length

    #1 can be accomplished with the MEASURE TOOL.
    #2 can be accomplished by using KNOWN angles

    I would think there would be an appreciable amount of coding to be able to specify all of the known variables and then use them in a formula
    to generate the arc. That would probably be a 'back burner' item at this point in time.

    As for #1, I submit the following:
    Launch and run the "Find Arc Length Test" script.
     

    Attached Files:

  5. NateLiqGrav

    NateLiqGrav Alibre Super User

    Arc length can be measured in design with the Measurement Tool.

    Since Alibre is based on ACIS, 2D-DCM, and 3D-DCM it should be trivial to add dimension tools for this for both design and drawing. They won't be the first ones to dimension arc lengths.

    https://www.plm.automation.siemens.com/en/products/open/d-cubed/2ddcm/


    Siemens PLM Software Releases 2D DCM, Version 57.0 and PGM, Version 57.0
    Posted by: DE Editors in Design, New Products, News June 23, 2010
    http://www.digitaleng.news/de/sieme...ses-2d-dcm-version-57-0-and-pgm-version-57-0/
     
    Last edited: Aug 3, 2018
    simonb65 likes this.
  6. Mika

    Mika Member

    Yeah, dimension in the drawing and sketch...I'm not so intrested what is happening in the equations in the heart of the computer processor.
     
    bigseb likes this.
  7. Lew_Merrick

    Lew_Merrick Alibre Super User

    OK, as someone who has been Drafting for 49 years, I have only used an Arc Length Dimension (maybe) three dozen times -- mostly defining Conveyor systems. To that degree I recognize that it does fall into the "rarely used" category. However the Arc Length Dimension has been part of Drafting Standards since (at least) 1928 (the oldest copy of Meir's & French's Engineerimng Drawing) I own. It is still recognized by ASME Y14.100-2013 Engineering Drawing Praciices (and, I believe, still defined under the 2015 update). Hence, it is a Dimension Form that should be included in Alibre Design. !!!
     
    Paul W and Mika like this.
  8. oldfox

    oldfox Alibre Super User

    It is, and Alibre calls it "MEASURE".
     
  9. Lew_Merrick

    Lew_Merrick Alibre Super User

    MEASURE is not a Dimension. See the attached JPG for one variation of an Arc Length Dimension.
     

    Attached Files:

    Mika and bigseb like this.
  10. bigseb

    bigseb Alibre Super User

    Lew and Mika make a good point. One can measure the arc length but not dimension them in drawings. Why not?
     
    Mika likes this.
  11. Mika

    Mika Member

    No more to say, you get the point. Thanks. :)
     
  12. Lew_Merrick

    Lew_Merrick Alibre Super User

    A few more things on this subject...
     

    Attached Files:

    NateLiqGrav and Mika like this.
  13. Mika

    Mika Member

    It would be so nice to use it in equation, when calculating conveyor chain length etc...
     
  14. Lew_Merrick

    Lew_Merrick Alibre Super User

    My "argument" is that we need a means to create a Sketch ("tied" to a Surface in most instances) that allows us to Constrain an entity to be (say) Tangent to the path of the Sketch as the mating Surface is moved. Something such as a Conveyor Chain only needs its Length when determining how much to buy (and the Measured Length is (typically) fine for that (though it would be nice could we assign a Measured Length to an Equation Editor Variable value)). If I am using a Roller Chain, then that Sub-Assembly will contain the Number of Rollers that using (Quanty of Rollers-1) X Length of Link gets you the Length of the Chain quite easily.
     
  15. ajayre

    ajayre Alibre Super User

    Add the following line to the end of the script I posted and now the arc length is a parameter that can be used in equations.

    Code:
    P.AddParameter('ArcLength', ParameterTypes.Distance, Length)
    
    Andy
     
  16. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hey Andy -- This is one that needs to be added to the "Wizo Book of Slick Tricks"!!!
     
    batejosh likes this.
  17. Mika

    Mika Member

    I use a software tools, not building that code behind those.
     
    bigseb and JL82 like this.
  18. bigseb

    bigseb Alibre Super User

    I agree with this. As much as I appreciate Andy's work and the fact that Alibre have implemented Wizoscript I am also not in a place where I intend to learn code. I like buttons that make it an easy job. If, say, gears could be created by clicking a gear button that opens a window to allow for data input and this process was editable/parametric that would be great :)
     
    Mika likes this.
  19. ajayre

    ajayre Alibre Super User

    There is a gear generator script included. Steps are:

    1. Click on AlibreScript tab
    2. Click on Launch
    3. Click on Gear Generator
    4. Click on Run and you will see:

    geargen.png

    No learning code required...

    Andy
     
    bigseb likes this.
  20. bigseb

    bigseb Alibre Super User

    My man! *fist bump*
     

Share This Page