⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • BoundindBox intersect problem

    12
    0 Szavazatok
    12 Hozzászólások
    408 Megtekintések
    Didier BurD
    Hi guys, Thanks for all these comments. What I'have done finally is the following: Made a hash with all my buildings and their local bounding boxes, Iterated through this hash and test all other bounding box points of other buildings, skiped all bounding boxes that are way too far to intersect with the considered building, coded a method to test if a 3dPoint is in a set of 8 points (a bounding box). This is a very fast and efficient process (about 200 buildings collisions (with all 199 others) tested in 0.5 second) Regards,
  • Md5 encoding in sketchup

    8
    0 Szavazatok
    8 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    These files do not belong in the "Plugins" dir. The should stay in the Ruby "lib" & platform dirs, and you should add those paths onto the $LOAD_PATH array. These so files also need "digest.rb" and "digest/sha2.so" (at least in Ruby 1.8.6-p287,.. where "md5.rb" is no longer needed.)
  • Open Component Options window with Ruby?

    6
    0 Szavazatok
    6 Hozzászólások
    519 Megtekintések
    D
    Excellent! That did the trick Dan, thank you!
  • 'Dynamic' array

    13
    0 Szavazatok
    13 Hozzászólások
    467 Megtekintések
    J
    Works like a charm now Thanks !
  • HTML 5?

    3
    0 Szavazatok
    3 Hozzászólások
    178 Megtekintések
    A
    @gaieus said: especially that IE 9 is only for Vista and above Exactly that is a problem. Now we are happy that IE6 is almost extinct and Microsoft's newest browser is nearly standards-compliant, but now Microsoft seems to abuse IE9 to get rid of Windows XP (and that can take long, meaning we still have to support IE8's peculiarities). Another problem is that Flash has generally been very cross-platform and cross-hardware and Flash or Java work also ok for 3D graphics (some might disagree). On the other side HTML5 WebGL has been designed not to work on older hardware.
  • Select component with ruby?

    8
    0 Szavazatok
    8 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    ruby will allow spanning lines with a \ (in some cases.)
  • Ruby plugin - Export from skp to Quake .map file

    4
    0 Szavazatok
    4 Hozzászólások
    944 Megtekintések
    TIGT
    Sketchup's UI API UI.open_panel(), and save_panel() etc Then folder=File.dirname(model.path) etc Read both the API, AND the general Ruby File/Dir stuff together... You don't need to use Dir.chdir() if you give File.new(fpath, 'w') the full-path to the file... which you can of course pre-assemble from the model's directory path and the new file's name, thus fpath=File.join(File.dirname(model.path), 'my.map') Of course you can check that the model has been saved and therefore not model.path.empty? before proceeding etc...
  • Best practices for working with cummulative transformations

    8
    0 Szavazatok
    8 Hozzászólások
    300 Megtekintések
    N
    @Thomthom: Great thread! All this OOP and geometry, I can't help but feel it verges on mental masturbation . It's almost metaphysical. I'll be using a bit of code from that thread. Thanks @TIG: The short answer is I'm trying to find the transformation of a lot of things. I'll give you some background. I'm trying to create a kind of project space for CNC manufacturing. The hiearchy looks something like this. ->MODEL --->ASSEMLY (Group/Component) ----->WORKPIECE (Component) ------->DESIGN (Group) --------->TOOLPATH (Group/Component) ----------->HOLE (Group/Component) Some things are forbidden. A toolpath can't contain any other groups or instances, a workpiece can't contain another workpiece. But I want to allow the user to further nest whatever they want. This means a workpiece can have a group of toolpaths or an assembly can have workpieces that are nested in other groups. At the risk of rambling on, I'll leave it at that. Let me know if I'm not clear (which is often the case when I try to explain anything related to OOP )
  • Best way to return a value from a tool ?

    6
    0 Szavazatok
    6 Hozzászólások
    206 Megtekintések
    Didier BurD
    Thanks Dan, I still had an attr_accessor :distance in that class
  • Face.position_material and uvh.get_front_UVQ

    6
    0 Szavazatok
    6 Hozzászólások
    499 Megtekintések
    A
    I absolutely agree about the missing method to get/set the projected property. Fredo, as for the problem with tapered textures, I think this is a question of bilinear texture mapping versus projective (http://www.cs.cmu.edu/~ph/texfund/texfund.pdf p. 14 & p.17), but isn't projective mapping default in most other applications? I can't think of any better solution than splitting the face into smaller quads.
  • Groups, Instances and Entities...

    4
    0 Szavazatok
    4 Hozzászólások
    185 Megtekintések
    N
    Sorry for rehashing old problems. I did look around the forums. Guess I just wasn't looking properly. Your reply was clear and concise TIG. I tried your code out and it worked a charm. Cheers!
  • [Code] FAQ: Detect if plugin is running on the Mac vs PC ?

    6
    0 Szavazatok
    6 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    Neither do I, as I had said in the OP.
  • [??] How to pass a variable from main.rb to a boxtool

    11
    0 Szavazatok
    11 Hozzászólások
    483 Megtekintések
    R
    Finally it works!!... BUT I had to move the rs_main.rb from the "\Plugins\as_plugins\as_rubyeditor\snippets"-folder to the "\Plugins"-folder, and then restart SU. At start up it showed the Alertbox "Helle World". BUT It won't work if I use the playbutton in AS-code editor. It seems like, when using modules, it has to be loaded into SU at startup. I wonder if there is a way to come around this? EDITED 1: It can be run directly from the snippet folder with ruby console (then SU requires no restart): load 'c:\path to the program\Google SketchUp 7\Plugins\as_plugins\as_rubyeditor\snippets\rs_main.rb' EDITED 2: in rs_main.rb require is changed to load. Then it updates the variables when its changed. So far so good! Thank you...
  • Limit on number or size of images to import

    8
    0 Szavazatok
    8 Hozzászólások
    273 Megtekintések
    Dan RathbunD
    Oh OK.. I see ... "paper dolls" I think the Watermark feature is too rudimentary. Match Photo would be more the thing to use. Too bad the images are a bit blurry. You could also import the elevations as a series of DWG views and they would be at scale, and actual edges.
  • Sketchup Plugin Debugger

    6
    0 Szavazatok
    6 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    It is for Smustard Menu Organizer
  • My Shadows Settings Panel can't be displayed

    3
    0 Szavazatok
    3 Hozzászólások
    138 Megtekintések
    JClementsJ
    Only way the problem could be resolved was by reinstalling SU over the existing installaton. Thank you for trying to help out.
  • <=> to determine version newer or older?

    9
    0 Szavazatok
    9 Hozzászólások
    209 Megtekintések
    thomthomT
    Oh, that works as well... And I've been comparing each value by itself when putting it all in an array works just as easy...
  • Face or line or vertex inside a solid

    4
    0 Szavazatok
    4 Hozzászólások
    188 Megtekintések
    voljankoV
    Hello Tig, I have also thought about rays. What do you think about this solution: If the tested object and a solid are not intersecting. If a ray from a tested object hits faces of a solid odd number of times ,the tested object is inside the solid. If the ray hits an edge or a vertex,repeat the ray test in other direction. David
  • What? No Menu?

    15
    0 Szavazatok
    15 Hozzászólások
    737 Megtekintések
    snicoloS
    @cjthompson said: That's because the code is executed all during one frame, which also explains why the one-liner works. My guess is that Sketchup creates a new menu , adds the items, and does the validation each frame, instead of just using one menu. This is exactly right. It depends on the context available when commands are executed. Another way to specify multi-line commands in Ruby is to use '' You could do: x = UI.menu('Plugins') \ x.add_item('Hello') { puts "World" } \ x.add_item('Hello2') { puts "World2" } and it would work and be all executed as a single command.
  • Create new layer with an RGB colour

    5
    0 Szavazatok
    5 Hozzászólások
    316 Megtekintések
    Dan RathbunD
    If you are starting with a fresh new model.. ie, Sketchup.active_model.modified? == false && Sketchup.active_model.title.empty? == true && Sketchup.active_model.path.empty? == true .. then you could open a new file from a template, that had the layers already set up. Otherwise... ... you can create a component definition, that has nothing but cpoints on your preset layers (names and colors and visibility,) and then save the component to your local component library. Then anytime you wish to use those layers, either manually open the component library and click on that component (you do not actually need to insert it into the model.) Here's a little SKP that has EIA colors assigned to Layer1 thru Layer9. (These are the colors you see on resistors or capacitors, that indicate their value. Sometimes also used by rainbow ribbon cables, to indicate pin number.) EIA_Color_Layers.skp Or.. via Ruby, you can load that component (say from a plugin sub-folder.) module Author module CustomLayers class << self def add_landscape_layers() plugs = Sketchup.find_support_file("Plugins") path = File.join(plugs,"Author/CustomLayers/LandscapeLayers.skp") mdl = Sketchup.active_model() defnset = mdl.definitions() landscape_layers_defn = defnset.load( path ) trans = Geom;;Transformation.new() # default identity transform inst = mdl.entities.add_instance(landscape_layers_defn,trans) inst.erase! end # def add_landscape_layers() end # proxy class end # submodule end # Author's toplevel module One drawback is that the color for the default layer ("Layer0",) must be set in the template files.

Advertisement