PartOperation

사용되지 않는 항목 표시

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.

모든 부품이 솔리드 모델링에 기반하여 상속하는 추상 클래스.

요약

속성

  • 플러그인 보안
    병렬 읽기

    단단한 모델링된 부품을 렌더링하는 데 사용되는 세부 수준.

  • 플러그인 보안
    병렬 읽기

    모델링된 부품의 부드러운 그림자에 영향을 주는 도 단위의 각도.

  • 읽기 전용
    복제되지 않음
    병렬 읽기

    이 솔리드 모델의 다각형 수입니다.

  • 병렬 읽기

    상속된 색 속성을 사용하여 PartOperation를 다시 색칠할 수 있는지 여부를 설정합니다.

속성TriangleMeshPart에서 상속되었습니다속성BasePart에서 상속되었습니다속성PVInstance에서 상속되었습니다

메서드

메서드BasePart에서 상속되었습니다메서드PVInstance에서 상속되었습니다

이벤트

이벤트BasePart에서 상속되었습니다

속성

RenderFidelity

플러그인 보안
병렬 읽기

이 속성은 솔리드 모델링된 부품이 표시될 세부 수준을 결정합니다.Enum.RenderFidelity 열거형의 가능한 값으로 설정할 수 있습니다.

기본값은 Automatic 이며, 부품의 세부 정보는 다음 표에 설명된 대로 카메라와의 거리에 따라 결정됩니다.


<th>렌더링 정확도</th>
</tr>
</thead>
<tbody>
<tr>
<td>250스터드 미만</td>
<td>최고</td>
</tr>
<tr>
<td>250-500 스터드</td>
<td>중간</td>
</tr>
<tr>
<td>500개 이상의 스터드</td>
<td>최저</td>
</tr>
</tbody>
카메라에서의 거리

SmoothingAngle

플러그인 보안
병렬 읽기

이 속성은 단단한 모델링된 부품의 페이스 정상 사이의 임계값에 대한 각도(도)를 나타냅니다.This property represents an angle in degrees for a threshold value between face normals on a solid modeled part.정상 차이가 값보다 작으면 정상이 차이를 부드럽게 하기 위해 조정됩니다.3070도 사이의 값은 일반적으로 좋은 결과를 생성하지만, 90180도 사이의 값은 날카로운 가장자리의 조합에 "그림자" 효과를 일으킬 수 있으므로 권장되지 않습니다.

부드러움이 서로 다른 재료 또는 색상 간의 정상에 영향을 주지 않는다는 점에 유의하십시오.

Solid modeled part with SmoothingAngle of 0

<figcaption><code>Class.PartOperation.SmoothingAngle|SmoothingAngle</code> = 0</figcaption>
Solid modeled part with SmoothingAngle of 50

<figcaption><code>Class.PartOperation.SmoothingAngle|SmoothingAngle</code> = 50</figcaption>

TriangleCount

읽기 전용
복제되지 않음
병렬 읽기

이 솔리드 모델의 다각형 수입니다.

UsePartColor

병렬 읽기

PartOperation 또는 BasePart.Color 또는 BasePart.BrickColor 속성을 사용하여 색상을 변경할 수 있는지 여부를 설정합니다.참이면 전체 연합이 Color 또는 BrickColor에 따라 색상이 지정됩니다.거짓일 경우 연합의 부품은 양파 작업이 수행되기 전의 원래 색상을 유지합니다.

메서드

SubstituteGeometry

()

PartOperation 의 기하학을 다른 PartOperation 의 기하학으로 대체합니다.이렇게 하면 솔리드 모델링 작업인 UnionAsync() , SubtractAsync() 또는 IntersectAsync() 의 기하학을 사용하면서도 주요 부분의 속성, 특성, 태그 및 자식을 유지할 수 있습니다(예: Attachments , Constraints , ParticleEmitters , 라이트 오브젝트, 데칼 및 더 많은 것).이 접근법은 또한 원래 PartOperation를 완전히 교체하는 잠재적 "깜빡임"을 회피합니다.

이 메서드를 자식 PartOperation 또는 자식 Attachments 또는 자식 Constraints 과 함께 호출하는 경우 CalculateConstraintsToPreserve() 에 영향을 받는 인스턴스를 계산한 다음 권장 부모가 nil 인 인스턴스를 삭제해야 합니다.

매개 변수

source: Instance

PartOperation 의 기하학이 이 PartOperation 의 기하학을 대체할 것인 기체입니다.

기본값: ""

반환

()

코드 샘플

The following example substitutes the geometry of one PartOperation with the geometry of another PartOperation, then drops constraints/attachments that should not be preserved after substitution.

Substitute Geometry and Drop Constraints

local GeometryService = game:GetService("GeometryService")
local mainPart = workspace.PurpleBlock
local otherParts = { workspace.BlueBlock }
local options = {
CollisionFidelity = Enum.CollisionFidelity.Default,
RenderFidelity = Enum.RenderFidelity.Automatic,
SplitApart = false,
}
local constraintOptions = {
tolerance = 0.1,
weldConstraintPreserve = Enum.WeldConstraintPreserve.All,
}
-- Perform union operation in pcall() since it's asyncronous
local success, newParts = pcall(function()
return GeometryService:UnionAsync(mainPart, otherParts, options)
end)
if success and #newParts > 0 and mainPart:IsA("PartOperation") then
-- Set first part in resulting operation as part to use for substitution
-- First part is simply an option; this can be any PartOperation
local substitutePart = newParts[1]
-- Reposition part to the position of main part
substitutePart.CFrame = mainPart.CFrame
-- Calculate constraints/attachments to either preserve or drop
local recommendedTable = GeometryService:CalculateConstraintsToPreserve(mainPart, newParts, constraintOptions)
-- Substitute main part's geometry with substitution geometry
mainPart:SubstituteGeometry(substitutePart)
-- Drop constraints/attachments that are not automatically preserved with substitution
for _, item in pairs(recommendedTable) do
if item.Attachment then
if item.ConstraintParent == nil then
item.Constraint.Parent = nil
end
if item.AttachmentParent == nil then
item.Attachment.Parent = nil
end
elseif item.WeldConstraint then
if item.Parent == nil then
item.WeldConstraint.Parent = nil
end
end
end
-- Destroy other parts
for _, otherPart in pairs(otherParts) do
otherPart.Parent = nil
otherPart:Destroy()
end
end

이벤트