Hi I ask questions about the push/pull function by group.
I was studying the API by referring to the API created by the user ‘dezmo’, but something is not going my way.
def pushpull_faces_in_selected_groups
prompts = ['Push/Pull Distance']
defaults = [0.to_l]
results = UI.inputbox prompts, defaults, 'Distance to Push/Pull'
distance = results[0]
model = Sketchup.active_model
targets = model.selection.grep(Sketchup::Group)
targets.each{ |target|
target.make_unique
tents = target.entities
faces = tents.grep(Sketchup::Face)
faces.each{ |e|
e.pushpull distance, true
}
}
end
pushpull_faces_in_selected_groups
In the case of the API referred to above, push/pull proceeds in the direction, but the selected face is reversed to confirm that a group is created.
In the tool currently under development (three.js), it is classified according to direction, so the normal value of the corresponding face is also important, so the face should not be reversed.
Second, the current height value (corresponding to distance) is given a -value (because the normal value of the default face is -Zaxis)
I ask if there is any way to go up only with Zaxis.
I always feel grateful for solving the problem with friendly explanations from users.
I would appreciate any help again.