🏢 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • File.dirname(__FILE__) returns nil?

    5
    0 Votes
    5 Posts
    877 Views
    W
    Weird, now the user says the problem is not occurring anymore without any explanation. Lovely! Sorry for wasting your time Dan,TiG. Thanks for the help!
  • Context Menu Question

    3
    0 Votes
    3 Posts
    96 Views
    K
    Thanks Dan that worked and was just what I needed. Keith
  • Looking for a report

    5
    0 Votes
    5 Posts
    166 Views
    genma saotomeG
    @dan rathbun said: Seems like you are trying to do things the hard way. Nope. I'm doing things "The Game Way". EXPORT the fewest polys, fewest textures, no textures on backfaces, no polys w/o textures. As minimal as possible... applying a texture to a component puts that texture on the backface -- I can't allow that. The code I showed, above, was what I use to identify and color untextured polys bright red (written by someone else). If they're big enough, I'll see them and either delete the poly or texture it correctly. 99 out of 100 times, I delete the poly. I need either a report OR a modification of the code I posted, whichever will get me a display/listing of all component/texture assignments. With the information in hand I can go right to the specific component definition and find the problem. W/O it's an ordeal.
  • Newbie question - execute jar file in ruby

    16
    0 Votes
    16 Posts
    3k Views
    Dan RathbunD
    Hmmm... OK. Yes, actually it's Ruby 1.8.x itself that uses "green threads" instead of native threads. You might have more luck using a OLE interface to the java. See: [Plugin Library] Win32API and Win32OLE so files and: WIN32OLE rdoc
  • Load_from_url

    22
    0 Votes
    22 Posts
    666 Views
    Dan RathbunD
    @tig said: There are new API methods with the latest v8M2 to extract files/subfolders [into Plugins] from zip/rbz files. However, if you already have ways of extracting them, then the moving to their new locations can be done with vanilla Ruby Dir and File commands... Or the extended library FileUtils FYI.. there is a Pure Ruby (beta) edition of the Zlib library that is cross-platfrom (no need to deal with compiled so/dll, Ruby version, compiler versions, etc. etc.) It is by Park Heesob (who is involved with Daniel Berger's win32-api project.)
  • 3d points of coplanar polygons - SketchUp Ruby API

    6
    0 Votes
    6 Posts
    864 Views
    V
    @sdmitch said: vhiguita, Are you still working on this problem or do you have a solution? I was interested in your problem and thought I would give it a try. Using the data from you post, I created a "html" file and created a plugin to read it and place the data. My html file contains the faces, lines and points but the lines and points are really the only data you need. I assummed the units were feet. It would help if I had an actual file to work with so post one if possible. Hi, I found the solution, there are many ways to get this, for example with PHP you could load all the html to a string, you could apply regular expressions to get the values (<div>,<span>, etc) from the tags review curl library.
  • Writing custom aditional data in .skp

    5
    0 Votes
    5 Posts
    173 Views
    AdamBA
    Just keep in mind that if you start attaching data to every Entity, you'll have massive file bloat.
  • Ruby Module Variables

    10
    0 Votes
    10 Posts
    2k Views
    A
    @dan rathbun said: All of your modules and/or classes need to be within your "author" namespace. If you need one copy of some code, make it a module. If you need multiple copies of some code, make it a class, and use multiple instances of the code. Ok, good advice, thaks . Now I'm on my way to 'Keep on typing' the code.
  • Need some help with write_image

    7
    0 Votes
    7 Posts
    350 Views
    jeff hammondJ
    @tig said: I think you'll need to at least make a temporary file and use some as/terminal/shell stuff ... osascript -e "tell app \"Finder\" to set the clipboard to (POSIX file \"~Documents/mytemp.png\")" perhaps i think something like that could work.. i found a way to do it with straight applescript (still using a temp file location) which eliminates using Finder.. set the clipboard to (read ("path/to/the/image.png") as «class PNGf»)
  • View.draw_text invisible?

    6
    0 Votes
    6 Posts
    517 Views
    thomthomT
    @aerilius said: (I hope the API comments will be back at the site at some time.) Yea - I'd made notes about the draw_points bug in the old comments...
  • BoundindBox intersect problem

    12
    0 Votes
    12 Posts
    222 Views
    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 Votes
    8 Posts
    1k Views
    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 Votes
    6 Posts
    467 Views
    D
    Excellent! That did the trick Dan, thank you!
  • 'Dynamic' array

    13
    0 Votes
    13 Posts
    301 Views
    J
    Works like a charm now Thanks !
  • HTML 5?

    3
    0 Votes
    3 Posts
    152 Views
    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 Votes
    8 Posts
    1k Views
    Dan RathbunD
    ruby will allow spanning lines with a \ (in some cases.)
  • Ruby plugin - Export from skp to Quake .map file

    4
    0 Votes
    4 Posts
    916 Views
    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 Votes
    8 Posts
    164 Views
    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 Votes
    6 Posts
    120 Views
    Didier BurD
    Thanks Dan, I still had an attr_accessor :distance in that class
  • Face.position_material and uvh.get_front_UVQ

    6
    0 Votes
    6 Posts
    436 Views
    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.

Advertisement