А тут двояко, если нормаль взять с обратным знаком, то положительный distance будет внутрь втягивать :-)Да. Но тогда скорее всего поменяется и ориентация у результирующего контура, что не есть хорошо.
Александр Ривилис, Благодарю!{0,0,1} - это вектор оси Z.
Я не понимаю причем тут Z=1 (и куда что то там вращается), но это работает
Я не понимаю причем тут Z=1 (и куда что то там вращается), но это работает
Перестанет, если Ваш Curveloop будет, например, в плоскости X0ZВы можете дать ссылку где об этом можно почитать подробнее?
Я переназначил Решение на ответ Александра, так как он более универсальныйЗамечательно) сам проверить сейчас не могу, завтра буду у компа и запущу)
Вы можете дать ссылку где об этом можно почитать подробнее?Об этом не нужно читать. Представьте себе, что этот CurveLoop - это контур стены (сбоку, а не сверху!!!). У него нормаль будет как раз в сторону, а не вверх, т.е. точно не по оси Z.
Вы можете дать ссылку где об этом можно почитать подробнее?
normal
Type: Autodesk.Revit.DB XYZ
The normal of the offset plane.
Remarks
For each curve in the curve loop, the offset curve is theoretically defined by translating every point of the original curve by the vector offsetDist * (curveTan x normal) where curveTan is the curve's unit tangent vector at the given point. The curves are then trimmed to create a continuous curve loop. For a planar curve loop, this amounts to pushing each point "to the right" of the curve loop by the signed offset distance offsetDist, within the plane of the curve loop. The "right" side of the curve loop at a given point on the curve loop is defined with reference to normal being thought of as the upward direction and curveTan being thought of as the forward direction, as if you are walking along the curve loop. It follows that if offsetDist is positive, points will be offset to the right of the curve loop, whereas if offsetDist is negative, points will be offset to the left of the curve loop.
If the curve loop contains curves such as elliptical segments or splines, it is possible the offset creation will fail if Revit will not be able to trim contiguous curves to meet one another. If the offset is successful, offsets of those curve types will be created as HermiteSplines.
Да ну? Работаем с контуром дырки из этой грани, берем нормаль из грани, вызываем CreateViaOffset с положительным distance, получаем смещение внутрь.Соглашусь с Вам. Метод CreateViaOffset, на мой взгляд, сделан плохо. Логично было бы, чтобы вектор просто задавал направление смещения и не зависел от самого CurveLoop. Да, судя, по замечаниям к методу, там слишком много проблем )) Много таких методов в API Ревита :(
defined by translating every point of the original curve by the vector offsetDist * (curveTan x normal) where curveTan is the curve's unit tangent vector at the given point