0 Пользователей и 1 Гость просматривают эту тему.
Через Polygon operations не получается загнать массив отступов.
ch = INITADDONSCOPE ("PolyOperations", "", "") PREPAREFUNCTION ch, "CreateContainer", "mySourceContainer", "" PREPAREFUNCTION ch, "CreateContainer", "myDestinationContainer", "" PREPAREFUNCTION ch, "SetSourceContainer", "mySourceContainer", "" PREPAREFUNCTION ch, "SetDestinationContainer", "myDestinationContainer", "" nVertices = k_otr_pl nContours = 1 dim vertArray[][] dim contourArray[] for i=1 to k_otr_pl vertArray[i][1] = otr_pl[i][1] vertArray[i][2] = otr_pl[i][2] vertArray[i][3] = 0 next i contourArray[1] = k_otr_pl+1 PREPAREFUNCTION ch, "Store", "poly1", nVertices, nContours, vertArray, contourArray itemIdx=1 PREPAREFUNCTION ch, "OffsetParams", "", itemIdx, offset_l dim resPolyIDArray[] numPoly = CALLFUNCTION (ch, "ResizeContour", "poly1", resPolyIDArray) polygonID = resPolyIDArray[1] gosub 100 ! Get one polygon contour data (without contours) if nsp > 0 then poly2_ nsp/3, 1+4, use(nsp) !!!! ТУТ ЗАБИРАТЬ РЕЗУЛЬТАТ for i = 1 to nsp step 3 hotspot2 get(2) get(1) next i else pen 20 text2 0,0,"!!ERROR!!" endif CLOSEADDONSCOPE (ch)100:! ==============================================================================! Get GDL Polygon! ------------------------------------------------------------------------------! Input variables:! ch: Channel ID! polygonID: Polygon ID!! Returned variables:! GDL stack: GDL polygon! ============================================================================== dim resVertices[] numVertices = CALLFUNCTION (ch, "GetVertices", polygonID, resVertices) numVertices = numVertices / 3 dim contArr[] numContours = CALLFUNCTION (ch, "GetContourEnds", polygonID, contArr) for contIndex = 1 to numContours if contIndex = 1 then begIdx = 0 else begIdx = contArr[contIndex] - 1 endif if contIndex = numContours then endIdx = numVertices - 1 else endIdx = contArr[contIndex + 1] - 2 endif bClosed = 0 bStartWithLast = 0 index = endIdx * 3 lastVertX = resVertices[index + 1] lastVertY = resVertices[index + 2] lastVertA = resVertices[index + 3] if abs(lastVertA) > EPS then put lastVertX, lastVertY, 1 bStartWithLast = 1 endif for vertIndex = begIdx to endIdx index = vertIndex * 3 actVertX = resVertices[index + 1] actVertY = resVertices[index + 2] actVertA = resVertices[index + 3] if vertIndex = begIdx then if bStartWithLast then ac2gdl_spx = lastVertX ac2gdl_spy = lastVertY else ac2gdl_spx = actVertX ac2gdl_spy = actVertY endif endif if abs(lastVertA) > EPS then ac2gdl_mx = (actVertX + lastVertX) / 2 ac2gdl_my = (actVertY + lastVertY) / 2 ac2gdl_ratio = 1 / 2 / tan (lastVertA / 2) ac2gdl_cx = ac2gdl_mx - ac2gdl_ratio * (actVertY - lastVertY) ! Arc center ac2gdl_cy = ac2gdl_my + ac2gdl_ratio * (actVertX - lastVertX) put ac2gdl_cx, ac2gdl_cy, 900, 0, lastVertA, 4001 endif if vertIndex > begIdx & abs(ac2gdl_spx - actVertX) < EPS & abs(ac2gdl_spy - actVertY) < EPS then put actVertX, actVertY, -1 bClosed = 1 else if vertIndex < endIdx | not(bStartWithLast) then put actVertX, actVertY, 1 endif endif lastVertX = actVertX lastVertY = actVertY lastVertA = actVertA next vertIndex if not(bClosed) then ! Close the polygon if it has holes put ac2gdl_spx, ac2gdl_spy, -1 endif next contIndexreturn
речь шла о разном отступе для разных отрезков. Одни отрезок отступает на 50 мм, другой на 100. ResizeContour изменяет весь конур на одну величину, или я ошибаюсь?
Продолжение моей панельки
в чем заключается "опасность"?
Автор ivasili Моделирование
Автор smile157 Темы о методах работы
Автор finfort Моделирование
Автор BuHHu Настройка ARCHICAD
Автор Коперник ARCHICAD для самых маленьких