Exploding group removes material from a face
-
Hi all,
I 've encountered this issue where when I am exploding a group, it causes one of the Faces to lose its material, although it doesnt belong in the group.
Is that an expected behavior, or is this a bug?Btw, the reason I am inserting each face, via a group that I explode, is because some of these faces might have holes, and carving out the holes, and then exploding the group is the most robust way I 've found so far that works.
Thanks,
YanisCode snippet:
inner = [[211.304795230314, 59.3387335473855, 144.121274015103], [198.016313479612, 93.8459200290483, 144.121274015103], [198.016313479612, 93.8459200290483, 209.586476052542], [211.304795230314, 59.3387335473855, 209.586476052542]] outer_right = [[123.368393800971, 287.689711452616, 222.214015434512], [124.599206984753, 284.49356753989, 222.214015434512], [124.599206984753, 284.49356753989, 7.04087985299685], [123.368393800971, 287.689711452616, 7.04087985299685]] outer_bottom = [[123.368393800971, 287.689711452616, 0.0], [123.368393800971, 287.689711452616, 7.04087985299685], [124.599206984753, 284.49356753989, 7.04087985299685], [278.931403899607, -116.27229864223, 7.04087985299685], [280.16221708339, -119.468442554957, 7.04087985299685], [280.16221708339, -119.468442554957, 0.0]] outer_left = [[278.931403899616, -116.272298642254, 222.214015434512], [280.16221708339, -119.468442554957, 222.214015434512], [280.16221708339, -119.468442554957, 7.04087985299685], [278.931403899607, -116.27229864223, 7.04087985299685]] outer_top = [[121.306929034951, 293.042869957925, 227.414539710024], [201.765305442185, 84.110634448818, 323.731055308166], [282.223681849419, -124.821601060289, 227.414539710024], [282.223681849419, -124.821601060289, 222.214015434512], [280.16221708339, -119.468442554957, 222.214015434512], [278.931403899616, -116.272298642254, 222.214015434512], [278.931403899616, -116.272298642254, 227.414539710024], [201.765305442185, 84.110634448818, 314.768300386351], [124.599206984753, 284.49356753989, 227.414539710024], [124.599206984753, 284.49356753989, 222.214015434512], [123.368393800971, 287.689711452616, 222.214015434512], [121.306929034951, 293.042869957925, 222.214015434512]] # place a textured inner face temp_group = Sketchup.active_model.entities.add_group inner_face = temp_group.entities.add_face inner material = Sketchup.active_model.materials.add "Test Material" material.color = 'red' inner_face.material = material temp_group.explode # place bounding faces temp_group = Sketchup.active_model.entities.add_group outer_right_face = temp_group.entities.add_face outer_right temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_bottom_face = temp_group.entities.add_face outer_bottom temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_left_face = temp_group.entities.add_face outer_left temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_top_face = temp_group.entities.add_face outer_top temp_group.explode # inner_face has lost it's material inner_face.material.nil? -
I can reproduce this but can't explain it. Seems like a bug to me!
-
Thanks slbaumgartner, this is what I thought too.
Can an admin maybe move this to the 'Report a Bug' subforum?
Maybe some SU folks out there will notice. -
inner = [[211.304795230314, 59.3387335473855, 144.121274015103], [198.016313479612, 93.8459200290483, 144.121274015103], [198.016313479612, 93.8459200290483, 209.586476052542], [211.304795230314, 59.3387335473855, 209.586476052542]] outer_right = [[123.368393800971, 287.689711452616, 222.214015434512], [124.599206984753, 284.49356753989, 222.214015434512], [124.599206984753, 284.49356753989, 7.04087985299685], [123.368393800971, 287.689711452616, 7.04087985299685]] outer_bottom = [[123.368393800971, 287.689711452616, 0.0], [123.368393800971, 287.689711452616, 7.04087985299685], [124.599206984753, 284.49356753989, 7.04087985299685], [278.931403899607, -116.27229864223, 7.04087985299685], [280.16221708339, -119.468442554957, 7.04087985299685], [280.16221708339, -119.468442554957, 0.0]] outer_left = [[278.931403899616, -116.272298642254, 222.214015434512], [280.16221708339, -119.468442554957, 222.214015434512], [280.16221708339, -119.468442554957, 7.04087985299685], [278.931403899607, -116.27229864223, 7.04087985299685]] outer_top = [[121.306929034951, 293.042869957925, 227.414539710024], [201.765305442185, 84.110634448818, 323.731055308166], [282.223681849419, -124.821601060289, 227.414539710024], [282.223681849419, -124.821601060289, 222.214015434512], [280.16221708339, -119.468442554957, 222.214015434512], [278.931403899616, -116.272298642254, 222.214015434512], [278.931403899616, -116.272298642254, 227.414539710024], [201.765305442185, 84.110634448818, 314.768300386351], [124.599206984753, 284.49356753989, 227.414539710024], [124.599206984753, 284.49356753989, 222.214015434512], [123.368393800971, 287.689711452616, 222.214015434512], [121.306929034951, 293.042869957925, 222.214015434512]] # place bounding faces temp_group = Sketchup.active_model.entities.add_group outer_right_face = temp_group.entities.add_face outer_right temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_bottom_face = temp_group.entities.add_face outer_bottom temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_left_face = temp_group.entities.add_face outer_left temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_top_face = temp_group.entities.add_face outer_top edges=temp_group.entities.grep(Sketchup;;Edge) temp_group.explode ### edges.each{|e| e.find_faces if e.valid?} # place a textured inner face temp_group = Sketchup.active_model.entities.add_group inner_face = temp_group.entities.add_face inner temp_group.explode ( material = Sketchup.active_model.materials.add("Red") ) unless material=Sketchup.active_model.materials["Red"] material.color="Red" # make 'red' once only inner_face.material = material ### # inner_face.erase! ### alternative # inner_face has lost it's material puts inner_face.materialThis works.
It adds a face within the overall form too.
The 'window' is colored after the explosion.
Note how I also only make a 'Red' material once.
You could erase the 'window' instead of making it 'Red'...
The order of operations and exploding groups affects the result, but knowing that you can avoid it.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement