[Plugin] Front Face - 1.2

[Plugin] Front Face - 1.2

Postby tomasz » Sat Oct 11, 2008 8:57 pm

Hi all,

I have written a small tool for reversing back faces only.
It is a kind of hybrid of Didier's ray casting solution and Todd's old scrtool.



It works like a paintbrush - right cick toggles reverse mode - just hover above back faces and they will be reversed.
Front faces will keep facing front, so do not worry you can move a cursor above whole
model without hesitation. No additional click required.
If you want back material to be turned into the default SU material, toggle special mode using CTRL key.

Installation - unpack both rb and FrontFace_files folder into Plugins folder. Restart SU :)

Tool works best in 'Monochrome display mode' because it will let you easily recognise which faces still need to be reversed. Make sure your model refreshes fast - the faster screen refresh the faster tool works.
When reversing faces in large model - it can be faster to do it by layers or by groups.

I intend to improve tool's efficiency by reversing all back faces in the whole surface that a face belongs to - subject to feedback from users :lol:

I invite you to a while of reflection about a role of LOVE in our lives while using this tool, because your brain will be quite idle during the process :) I kindly suggest you to spend saved time with ones that you love! You can trade with your boss - whole model reversed in half an hour - afternoon off the work in return :D

EDIT:

version 1.2 (7th December 2009) - icons added, CTRL toggles a mode which replaces back material with the default, FrontFace is no longer afraid of hidden layers or faces, cuts through them like through a butter

Cheers
Tomasz
11
Last edited by tomasz on Mon Dec 07, 2009 6:21 pm, edited 6 times in total.

tomasz 
SU2TH & SU2KT Developer
 

Re: [Plugin] Front Face (TM) Tool

Postby CadFather » Sat Oct 11, 2008 9:16 pm

Fantastic Tomasz - great idea!

Tomasz wrote:I invite you to a while of reflection about a role of LOVE in our lives while using this tool, because your brain will be quite idle during the process :) I kindly suggest you to spend saved time with ones that you love! You can trade with your boss - whole model reversed in half an hour - afternoon off the work in return :D
Tomasz
:thumb:

SuperThanks! :D
0
Quarr-IT - SketchUp Training from the Master.. http://quarr-it.com/
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Front Face (TM) Tool

Postby Jim » Sat Oct 11, 2008 9:36 pm

Sometimes, as in this case, fewer options are better. Thanks!
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] Front Face (TM) Tool

Postby maxosmedia » Sat Oct 11, 2008 10:23 pm

Great! Thanks!!!
0

maxosmedia 
 

Re: [Plugin] Front Face (TM) Tool

Postby tomasz » Sun Oct 12, 2008 11:07 am

This tool and probably any other face reversing tool is not able to reverse correctly projected textures, as it would require correct readout of the face UVs and reapplying them to the opposite side of a face.

Please find an example attached. When using the tool on the back faces you will notice that texture on the former front face have wrong - default UVs. I will post soon a new version that copies UVs between Front and Back material. I will need your help as I was not able to solve it on my own.

Can we all try to solve this UVs issue? I am sure there are Ruby programmers who know exactly how to read correct UVs of a nested face.

Tomasz
1

tomasz 
SU2TH & SU2KT Developer
 

Re: [Plugin] Front Face (TM) Tool

Postby tomasz » Sun Oct 12, 2008 12:09 pm

I have found that the plugin reverses Front Faces as well in nested components& groups.
I have forgotten about transformation of an instance.. :roll: :oops:
Of course the process is fully reversible, but just to inform you there is a bug. It looks I will have to use ray-casting as well.

EDIT: - Done. Plugin updated - v.1.1.

Tomasz
0

tomasz 
SU2TH & SU2KT Developer
 

Re: [Plugin] Front Face - 1.1

Postby pilou » Sun Oct 12, 2008 2:34 pm

Does not possible to have the possibility to make "all selection" of the front face with the first facet choosen for avoid to paint all the other same facets one by one?
Seems that will be very more useful and not a big modification of this cool plug :enlight:
SKP linked for test ;)
0
Last edited by pilou on Sun Oct 12, 2008 3:25 pm, edited 7 times in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Front Face - 1.1

Postby EarthMover » Sun Oct 12, 2008 2:35 pm

Great tool Tomasz. Works like a charm. Just wanted to say thanks!
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Front Face - 1.1

Postby tomasz » Sun Oct 12, 2008 4:51 pm

Tomasz wrote:I intend to improve tool's efficiency by reversing all back faces in the whole surface that a face belongs to - subject to feedback from users :lol:

Thanks for a test file :)
0

tomasz 
SU2TH & SU2KT Developer
 

Re: [Plugin] Front Face - 1.1

Postby TIG » Sun Oct 12, 2008 8:35 pm

Look on Didier's site for my 'orient faces' script...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Front Face - 1.1

Postby cyan.archnet » Mon Oct 13, 2008 5:48 am

a BIG THANKS to you!!!
0

cyan.archnet 
 

Re: [Plugin] Front Face - 1.1

Postby tomasz » Mon Oct 13, 2008 7:51 am

TIG wrote:Look on Didier's site for my 'orient faces' script...

Thanks TIG! Downloaded. :)

cyan.archnet wrote:a BIG THANKS to you!!!

You welcome. It can be handy for large, urban scale models, modelled by someone who had no clue about rendering application requirements.
0

tomasz 
SU2TH & SU2KT Developer
 

Re: [Plugin] Front Face - 1.1

Postby Daniel Bouchard » Tue Oct 14, 2008 12:40 am

Thanks Tomasz for this great plugin. :thumb:
0
Last edited by Daniel Bouchard on Wed Oct 15, 2008 4:21 am, edited 1 time in total.

Daniel Bouchard 
 

Re: [Plugin] Front Face - 1.1

Postby pilou » Tue Oct 14, 2008 8:58 am

Sorry but how call the Tig Orient.face.rb?
In what Menu, or with what Click mouse?
I suppose with the Ruby console?
How must be the selection? Facets selected? Group Selected?...

I obtain that with the ruby Console with "face.orient_faces" or "orient.face" input in the console

Code: Select all
Error: #<NameError: (eval):495: undefined local variable or method `face' for main:Object>
(eval):495

So I am perplex ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Front Face - 1.1

Postby TIG » Tue Oct 14, 2008 12:06 pm

Pilou wrote:Sorry but how call the Tig Orient.face.rb?
In what Menu, or with what Click mouse?
I suppose with the Ruby console?
How must be the selection? Facets selected? Group Selected?...

I obtain that with the ruby Console with "face.orient_faces" or "orient.face" input in the console

Code: Select all
Error: #<NameError: (eval):495: undefined local variable or method `face' for main:Object>
(eval):495

So I am perplex ;)

As the guidance notes at the start say...

It matches the orientation of a face to any connected 'co-edged' faces.
It mimics SketchUp's "Orient Faces" Tool.
It can sometimes produce slightly different results when more than two
connected faces share a common edge. Its results are equally logical,
and who's to say how they should orient anyway ?
Ideas on how to duplicate the built-in tool are welcomed...
You can call it from other scripts thus: face.orient_faces

i.e. if you put the script in the Plugins Folder it creates a new method - a 'Face' now has an extra method called "orient_faces"

Let's say you have a face that's been chosen in your script which has been given the variable 'face', then adding in the line
Code: Select all
face.orient_faces

will make any other faces that adjoin it [or its neighbours etc] flip to match that chosen face's orientation (normal) - just like the built-in 'orient faces' does in the right-click context-menu when you select a face...

.
0
Last edited by TIG on Tue Oct 14, 2008 8:58 pm, edited 2 times in total.
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] Front Face - 1.1

Postby Panga » Tue Oct 14, 2008 12:08 pm

Thanks for this script...saved time'll be well used !!
0

Panga 
Premium Member
Premium Member
 

Re: [Plugin] Front Face - 1.1

Postby pilou » Tue Oct 14, 2008 1:02 pm

@ Tig thx for your efforts but I miss something :oops:
Don't worry I will ask on the French forum that it is not clear for me ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Front Face - 1.1

Postby tomasz » Tue Oct 14, 2008 1:07 pm

Pilou,
What TIG has sent is a help for me. The 'orientface' script contains useful method that I can add into my plugin, which will happen soon if everything will go fine. :)

Panga wrote:Thanks for this script...saved time'll be well used !!

:thumb: :D

Tomasz
0

tomasz 
SU2TH & SU2KT Developer
 

Re: [Plugin] Front Face - 1.1

Postby tomasz » Tue Oct 14, 2008 1:40 pm

I am testing your method TIG and it is working fine for Pilou's ball, but it is not dealing well with urban model I have.
I have two ideas how to modify your method to suit FrontFace plugin better.

1st - limit connected faces only to those with soften edge.
2nd - limit to faces at lower angle then 90 deg.

Will try and see.

Pilou if you want to see how it works modify this method in frontface.rb as follows:

Code: Select all
def reverseFace(face)
   face.reverse!
   face.material, face.back_material = face.back_material, face.material
   face.orient_faces
end


Tomasz
0

tomasz 
SU2TH & SU2KT Developer
 

Re: [Plugin] Front Face - 1.1

Postby pilou » Tue Oct 14, 2008 1:46 pm

@ Tomasz
I have also try the original SU Internal "Orient face" and it works fine also with my ball with only one click ;)
Your works also after the modification but you must over flight all the facets :enlight:
0
Last edited by pilou on Tue Oct 14, 2008 3:40 pm, edited 2 times in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Front Face - 1.1

Postby boofredlay » Tue Oct 14, 2008 2:26 pm

Thanks for this. It will prove to be very useful.
0
User avatar
boofredlay 
Global Moderator
 

Re: [Plugin] Front Face - 1.1

Postby Ben Ritter » Tue Oct 14, 2008 5:29 pm

Tomasz, thank you very much.

Ben
0

Ben Ritter 
 

Re: [Plugin] Front Face - 1.1

Postby alz » Tue Oct 14, 2008 7:03 pm

Very useful!

Could you add a "hold down left mouse" to have it be active? This would prevent accidental flipping when simply moving your mouse around in the scene.

Another possibility -- when being used, toggle to a different Style (say Gray = front face, Red = back face).

:)
0

alz 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Front Face - 1.1

Postby boofredlay » Tue Oct 14, 2008 7:05 pm

alz wrote:Could you add a "hold down left mouse" to have it be active? This would prevent accidental flipping when simply moving your mouse around in the scene.

That or change the cursor to something different while active.
0
User avatar
boofredlay 
Global Moderator
 

Re: [Plugin] Front Face - 1.1

Postby tomasz » Tue Oct 14, 2008 7:20 pm

Boofredlay wrote:That or change the cursor to something different while active.

Good idea Boofredlay - added to the 'TO DO' list.
alz wrote:Could you add a "hold down left mouse" to have it be active? This would prevent accidental flipping when simply moving your mouse around in the scene.

I think your finger will fail with big scenes to work correctly for a longer period :),
but... I could turn it on permanently when a LMB would be pressed longer then.. say 5 sec.
alz wrote:Another possibility -- when being used, toggle to a different Style (say Gray = front face, Red = back face).

I prefer let user decide what monochrome style looks like.

Thanks
Tomasz
0

tomasz 
SU2TH & SU2KT Developer
 

Re: [Plugin] Front Face - 1.1

Postby boofredlay » Thu Jan 22, 2009 6:24 pm

Any progress on changing the cursor Tomasz?
I am using it today and was just curious. Handy tool BTW.
0
User avatar
boofredlay 
Global Moderator
 

Re: [Plugin] Front Face - 1.1

Postby Gaieus » Sun Dec 06, 2009 11:06 am

Hi Tomasz,

Thanks for this gem!

One question (or maybe a feature request) - after reversing the face (and successfully applying the back face material on the front face), could the plugin also delete the material applied on the back face? I.e. to paint the back face with the default (grey/blue) material.

OR - alternatively - does anyone know a plugin that would delete all materials applied to back faces only?
0
User avatar
Gaieus 
 

Re: [Plugin] Front Face - 1.1

Postby thomthom » Sun Dec 06, 2009 1:29 pm

Gaieus wrote:OR - alternatively - does anyone know a plugin that would delete all materials applied to back faces only?


I could add that to my Remove Marerials plugin.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Front Face - 1.1

Postby Rich O Brien » Sun Dec 06, 2009 1:33 pm

Thom,

That'd be an excellent feature and much appreciated :thumb:

Rich
0
There's a frontroom and a backroom....reverse faces
User avatar
Rich O Brien 
Administrator
 

Re: [Plugin] Front Face - 1.1

Postby Gaieus » Sun Dec 06, 2009 2:04 pm

Yes, Thom, that would be very handy.

But of course, such a (to me very sophisticated but for you, guys, probably easy) modification for this FrontFace Plugin would also be handy - so that you need not fiddle with two different plugins (although the very simplicity of this plugin is also charming - no settings, no hassle with dialogs - just "brush" over the model and voilá)
0
User avatar
Gaieus 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: Floriannn and 7 guests

Visit our sponsors: