• 易迪拓培训,专注于微波、射频、天线设计工程师的培养
首页 > 电子设计 > PCB设计 > Allegro PCB技术问答 > 两个让我费解的函数

两个让我费解的函数

录入:edatop.com     点击:

1,

axlPathArcCenter(
r_path
f_width
l_end_point
g_clockwise
l_center----------------这个就是中心啊.这个函数究竟是干什么的?究竟是求什么中心?!
)
? r_path/nil

2,axlPathSegGetArcCenter
axlPathSegGetArcCenter(
r_pathSeg
)
? l_point/nil
Description
Gets the center point of a path arc segment.
Arguments
r_pathSeg Handle of a path arc segment.
Value Returned
l_point List containing the center coordinate of the arc segment.
nil Segment is not an arc.
Example
axlPathSegGetArcCenter gets the center of the last arc segment.
path = axlPathStart( (list 1000:1250), 173)
axlPathLine( path, 29, 2000:1250)
axlPathArcCenter( path, 12., 3000:2250, nil, 2000:2250)------不是已经知道中心点坐标了吗为什么还要求?
lastSeg = axlPathGetLastPathSeg(path)
axlPathSegGetArcCenter( lastSeg)
?(2000 2250)-----

3,如果上面函数可以求得arc中心的话,那这个函数也是?

axlGeoArcCenterAngle
axlGeoArcCenterAngle(
l_startPoint
l_endPoint
f_angle
[g_clockwise]
)
? l_center/nil
Description

头痛啊,大虾们帮忙解读解读!谢谢哦
Calculates the center of an arc given the angle between its endpoints.

一个是设置路径,一个是读取路径的中心,看来你学skill迷糊了,已经晕了?
axlPathArcCenter()是画路径,许多类似的函数都是操作执行用(写数据)
axlPathSegGetArcCenter()。看见这个“GET"没?,这类函数才是测试用(读取数据)

你理解函数的时候要看函数的名称以及函数参数和返回函数的类型就自然理解了的。
你别告诉我你以前没编过程序吧(BASIC, JAVA, C/C++, PERL....)?如果是的话,要去补补编程的基础知识哈。

r_pathSeg如何取得?

path = axlPathStart( (list 1000:1250), 173)
axlPathLine( path, 29, 2000:1250)
axlPathArcCenter( path, 12., 3000:2250, nil, 2000:2250)------不是已经知道中心点坐标了吗为什么还要求?
lastSeg = axlPathGetLastPathSeg(path)

axlPathSegGetArcCenter( lastSeg)
?(2000 2250)

例子中中心点都已经知道了,何来求中心的问题,而且精度好像也没达到:

Prints the center for the clockwise arc going through the points (7500:5600) and (8000:4700)
using axlGetArcCenterAngle, then adds the arc through those points using
axlPathArcAngle, and compares their centers.
The arc is shown in the following figure.
Do Show Element on the arc to show its center coordinate. The arc lists: “center-xy
(7089,4783)” which agrees with the (7089.086 4782.826)

不懂

procedure( test()
popup = axlUIPopupDefine(nil
    (list
       (list "Done" `axlFinishEnterFun)
    (list "Cancel" `axlcancelEnterFun)
      )
      )
 axlUIPopupSet(popup)
 (axlClearSelSet)
 (axlSetFindFilter ?enabled  (list "noall" "Lines" "nameform")
                 ?onButtons  (list "noall" "Lines"))
 ( while (axlSelect)
  lines = axlGetSelSet()
    foreach(line lines
    bBox=line->bBox
    sp=car(bBox)
    ep=list(caadr(bBox) cadadr(bBox))
  println(sp)
  println(ep)
  center=axlGeoArcCenterAngle(
    sp ep 180
    )

    )

      println(center)
   )
   )
  

请教:我得到的中心点就是按照180弧度得到的,但如果是任意一个SEGMENT我如何取得这个参数?!

谢谢各位老大帮忙.

可以用以下方法取得:

car(car(Your select lines)->segments)->xy

xy就是arc中心了。

Cadence Allegro 培训套装,视频教学,直观易学

上一篇:Database Check 的问题
下一篇:誰有Allegro 15.2版的學習教程!

PCB设计培训课程推荐详情>>

  网站地图