sketchucation logo sketchucation
    • Login
    1. Home
    2. fredo6
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
    Offline
    • Profile
    • Following 0
    • Followers 55
    • Topics 173
    • Posts 5,302
    • Groups 3

    Posts

    Recent Best Controversial
    • RE: [Obsolete] Joint Push Pull

      @urgen said:

      Very good script 👍 , but in SU5 unfortunately does not work ... 😢

      Can you try this version. It may be slower however!


      Supposed to work in Sketchup 5 too

      posted in Plugins
      fredo6F
      fredo6
    • RE: Push Pull Jointif

      Serieux. Je suis a la recherche de cas ou il y a des problemes, pour savoir si on peut y faire quelque chose (de mon cote j'en ai quelques uns!). La methode que j'utilise est plutot empirique et en plus Sketchup est assez capricieux question creation et orientation de faces.
      Si ca se passe pas trop mal, direction Ruby Depot, avec ta permission.

      posted in Français
      fredo6F
      fredo6
    • Push Pull Jointif

      Juste pour ne pas oublier mes chers compatriotes, j'ai publie a l'essai un script de push pull jointif dans la section Ruby. La doc est pour l'instant en anglais.
      http://www.sketchucation.com/forums/scf/viewtopic.php?f=57&t=4840&st=0&sk=t&sd=a
      Une petite image pour illustrer l'intention:


      Push-pull methods.jpg

      posted in Français
      fredo6F
      fredo6
    • RE: [Obsolete] Joint Push Pull

      @greyhead said:

      Fantastic, enjoyed playing with it. Now I need to find a place to use it.

      Thanks, Bob

      PS Confirming bellwells image earlier, if you use Joint push-pull on non-contiguous faces of an polygon block then the side of the extrusions have a mix of angles, some are rectilinear (as from the Vector extrusion) some are aligned to the center of the block.

      GreyHead

      Thanks for appreciation.
      Regarding the non contiguous faces, what you get is normal, because it depends on what you want to achieve. If you wish the borders to be perfectly normal, you must select NO in the option "Extent influence to non-selected neighbors", as explained in the Tutorial, in section 1.7, p.12. Otherwise, the macro compute the direction as if you would also extrude the neighbouring face. Unless I missed something....

      Fredo

      posted in Plugins
      fredo6F
      fredo6
    • RE: [Obsolete] Joint Push Pull

      @daniel s said:

      Edit:PS. Yes.. like bellwells says... there are hidden edges.. in a lot of cases don´t looks good... would be better to use "soften edges"

      Actually, I did not know what was the most appropriate, hidden or soft, because there are advantages for both in any situation.
      This is easy to fix (see attached file modified).
      The question is whether I leave this as an option


      version with soft / smooth edges instead of hidden

      posted in Plugins
      fredo6F
      fredo6
    • [Obsolete] Joint Push Pull

      Here is a very first version of what I call Joint Push Pull, which is a compromise between the classic Sketchup push pull along individual face normals and the Vector Push pull whihc keeps faces contiguous. In other terms, how to extrude faces along their normal, but generate a contiguous shape.

      I guess the pictures attached are self-explanatory on what the script tries to achieve.

      The ZIP archive should be unzipped in the Plugins folder and create in the Plugins folder:

      • jointpushpull.rb, the main macro
      • LibPlaneSelectorTool.rb, to select a custom plane
      • LibVectorSelectorTool.rb, to select a custom vector
      • LibTraductor.rb, for language translation and dialog boxes. This is a new version (you must use this one, but it is compatible with the previous version published with Bezierspline)
      • LibTraductor.def, an optional configuration file allowing override of language
      • A folder JPP_Dir, which contains the 2 icons for the toolbar
        The script creates 2 menu entries in the Tools menu
        The script also implements Classic Push Pull and Vector Push pull

      There is a full doc in PDF, but it is too large to upload on this site. So I put it on the Google forum at http://groups.google.com/group/Ruby-API/browse_thread/thread/6ae80c5c688083fb.


      Comparing Classic vs. Vector vs. Joint Push Pull methods


      Works also for insets


      to unzip in the Plugins folder - Update with smooth / soft edges

      posted in Plugins
      fredo6F
      fredo6
    • RE: Shear object?

      Coincidentally, I am currently working of this type of transformation which I call Non Uniform Linear Transformations (NULT), that are not native in Sketchup and end up recreating the drawing element.

      I had completed the Plane Shear a while ago and need to finish the box shear.

      Plane Shear is actually a transformation that would deform a rectangle into a parallelogram (in 3D space). Box shear, is a variant that allows non uniform scaling, typically transform a sphere into an egg. The question here is more how you specify what you want to do (my current idea is to do it via a transformation box)

      Attached in the Plane Shear. You specify the plane, the reference direction and the angle. This is why the tool behaves pretty much as a Protractor tool. The tool applies to the Selection, but you can include what you want in it (groups, components, images, etc...) at any nested level. It preserves and deforms textures, as well as layers, attributes and properties. The only restrictions are:

      • Components are transformed into Groups, because there is no way to preserve the component definition for all instances, as they may be rotated and scaled
      • Images are transformed in planar face, with the image texture sheared (Sketchup does not support images in parallelogram as far as I know!)
      • Dimensions are not transformed because Sketchup does not provide a Ruby API for these objects
      • Interestingly, the transformation preserves Bezier and other Spline curves

      Here is a basic example with a simple parallelepiped, but you can find a more complex situation at http://escargot-archi.eu/forum/viewtopic.php?t=2299 (a French site, but the image is self explanatory). For this kind of objects with 1,400 faces, it takes longer (the macro has a progress bar anyway).

      There is no documentation at the moment, and this is why I do not publish it yet.

      The Zip archive attached contains 5 files, all to go to the Plugins Directory:

      • Nult.rb, the main macro
      • LibProtractorTool.rb, a utility to emulate the Protractor tool (if anyone interested, it can be used as an independent tool for other purposes).
      • LibTraductor.rb, a utility to language translation. You may already have it with the Bezierspline macro, but this one is more recent and anyway compatible.
      • LibTraductor.def, an optional configuration file to force language.
      • **iconshear.png**which is for the toolbar button
      • **cursorshear.png**for the cursor shape

      Feedback welcome. Thanks

      Fredo


      Shear box.jpg


      Bibli.jpg


      to unzip in Plugins folder

      posted in Plugins
      fredo6F
      fredo6
    • RE: Shear object?

      @daniel s said:

      The only problem is that every time i make a shear... the new object appears with hidden lines..

      My mistake, as the macro is not fully tested. I reloaded the Zip file with correct behavior (I hope).

      @daniel s said:

      This plugin can be converted into a Lattice tool?

      Yes. That's what I call the NULT Box, which is a downgraded version of lattice tools you can find in many 3D design tools (such as Blender), as the deformed box must keep its 6 faces planar. What I am working on is the GUI to specify the deformation. The transformation algorithm is exactly the same as for Plane shear (i.e. based on vertex non uniform translation).

      posted in Plugins
      fredo6F
      fredo6
    • RE: Ruby console intruder

      Can someone check if Sketchup changed the version of the Ruby Interpreter (normally 1.8), because these messages maybe a sign of an evolution on the Ruby side.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Group color setting in ruby

      Just use e.material, where e is an instance of a Group, as a Group is a Drawing Element.
      This set the material for the group, used as a default by its elements if they do not have a material by themselves.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Solved: need help with groups and their names

      Sorry, I meant e.typename == 'Group'
      If you prefer to use class id, then you must NOT enclose it between quotes
      --> e.class == Sketchup::Group

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Solved: need help with groups and their names

      You should check the type too (e.type == 'Group') as there may be other drawing elements with the same name

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Select All Surfaces in a Model? Need assistance.

      Then you need to add one line of code (in the When 'Face' section)to change the "soft" property of the edges bording the faces. This slows down the script a little bit, but I undersatnd why you need it.

      
      def process_faces
      	model = Sketchup.active_model
      	model.start_operation "erase all faces"
      	process_faces_at_level model, {}
      	model.commit_operation
      end
      
      def process_faces_at_level(grp, hcomp)
      	list_entities = []
      	grp.entities.each do |entity| 
      		case entity.typename
      		when 'Group'
      			process_faces_at_level entity, hcomp
      		when 'ComponentInstance'
      			edef = entity.definition
      			next if hcomp[edef.to_s]
      			hcomp[edef.to_s] = edef
      			process_faces_at_level edef, hcomp
      		when 'Face'
      			list_entities.push entity  # or do what you want with the face
      			entity.edges.each { |e| e.soft = false } #Keep smooth edges
      		end
      	end
      	grp.entities.erase_entities list_entities
      end	
      
      
      
      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Select All Surfaces in a Model? Need assistance.

      I am not clear on what you want.
      Do you want to keep faces which have at least one edge smoothend or softened?
      Or do you want to change the property of these edges, and still erase all faces?

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Select All Surfaces in a Model? Need assistance.

      If you need to earse all faces at all levels, then you must do it differently
      Here is a code sample

      
      def process_faces
      	model = Sketchup.active_model
      	model.start_operation "erase all faces"
      	process_faces_at_level model, {}
      	model.commit_operation
      end
      
      def process_faces_at_level(grp, hcomp)
      	list_entities = []
      	grp.entities.each do |entity| 
      		case entity.typename
      		when 'Group'
      			process_faces_at_level entity, hcomp
      		when 'ComponentInstance'
                              edef = entity.definition
      			next if hcomp[edef.to_s]
      			hcomp[edef] = edef
      			process_faces_at_level edef, hcomp
      		when 'Face'
      			list_entities.push entity  # store faces in the list
      		end
      	end
      	grp.entities.erase_entities list_entities #or do what you want with the faces
      end	
      
      

      Note the specific treatment of component instances, as you must delete the face only once in its definition (which will propagate then to all instances)

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Select All Surfaces in a Model? Need assistance.

      Here is a simple code to select all faces at the model level

      
      def select_all_faces
              model = Sketchup.active_model
              model.selection.clear	#empty the current selection
              model.entities.each { |e| model.selection.add e if e.typename == 'Face' }
      end
      
      

      Note that you cannot select entities at different levels, for instance in the first level of the model and at the same time within groups or component instances

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: How can I store binary data in an attribute

      @unknownuser said:

      ps Fred, if you are saving 3D points as attributes - what happens when a user moves the spline?

      Very interesting question, that I did not ask myself (actually, I just inherited the method from the previous bezier.rbscript by @Last). But magically, it seems to work fine, whether you move, scale or rotate the curve.

      There must be a trick!

      But this macro is full of surprise, for instance with an undocumented method "curve.move_vertices", which allows moving the vertices of a curve without having to recreate one.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: How can I store binary data in an attribute

      I had the same problem with binary strings, because Sketchup stops the decoding at first \0 character.

      But if you just wish to store an array of fixnum, why don't you store it 'naturally'. Sketchup entity attributes does it well, back and forth. I used this for my bezierspline.rb macro, where I do store arrays of 3D-points in this way.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Keyboard translation PC / Mac

      Thanks very much Todd.

      There are strange things on the Mac, like the fact that several keys (alphas and numpad) do nt seem to be trapped on the KeyDown, but only on the KeyUp event. This is also the case for Tab, Del and Backspace. This may be due to the VCB interference.

      I'll see what I can do.

      Thanks again

      Fredo

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Keyboard translation PC / Mac

      Thanks.
      For the time being, I will follow your advice (and also use File.join instead of building the string with /

      posted in Developers' Forum
      fredo6F
      fredo6
    • 1 / 1