Skip to content

Conversation

@aammiirr2201-collab
Copy link

model = Sketchup.active_model
ents = model.active_entities
sel = model.selection

faces = sel.grep(Sketchup::Face)

if faces.empty?
UI.messagebox("هیچ Faceای انتخاب نشده")
return
end

model.start_operation("2mm Gold Polish Group", true)

گروه‌کردن

group = ents.add_group(faces)
gents = group.entities

ضخامت 2 میلی‌متر

faces.each do |f|
begin
f.pushpull(2.mm)
rescue
end
end

ساخت متریال طلایی

mats = model.materials
gold = mats["Gold_Polished"] || mats.add("Gold_Polished")
gold.color = Sketchup::Color.new(212, 175, 55)
gold.shininess = 80

اعمال متریال

group.material = gold

نرم‌کردن لبه‌ها (حس پولیش)

edges = gents.grep(Sketchup::Edge)
edges.each do |e|
e.soft = true
e.smooth = true
end

model.commit_operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant