sketchucation logo sketchucation
    • Login
    1. Home
    2. OricAtmos
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 37
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: [Code] Raytest Util

      @adamb said:

      The wavelength of light is small so mostly you can ignore diffraction effects and treat light as moving in straight lines. Audio wavelengths are much longer and have significant diffraction around corners (hence you can hear round corners!), so how does using (straight line) raytracing help here?

      Good observation! Raytracing is essentially just an approximation of how sound travels. Diffraction can't be modeled that way. As far as I know, simulating diffraction is still a hot topic in the field of acoustics and there's no catch-all automatic solution yet. (I'm not an expert in acoustics, I'm just a Computer Science student doing some coding at an acoustics chair/institute)

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: [Code] Raytest Util

      @aerilius said:

      I really see no advantage of having an imperfect built-in (or Ruby plugin) raytracer, while there are already so many dedicated renderers with better illumination models, more speed and more realistic output.

      Yeah, I guess the raytest function would need to be able to take an array of rays and do multithreaded casting to be comparable to an external raytracer. By the way, we're doing room acoustics simulation, not visual rendering, with our plugin.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: [Code] Raytest Util

      Thanks!

      @adamb said:

      No, it is not suitable for raytracing etc where you'll be casting millions of rays.

      That's too bad, since this could be useful. πŸ˜„

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: [Code] Raytest Util

      Does anyone know how raytest is implemented? Does SketchUp use a BSP or some other data structure to speed up geometry searches?
      In other words, is raytest reasonably fast or is it done in a brute-force manner?

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: [SU2014] character encodings and the Ruby console

      Thanks, that might come in handy!

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: [SU2014] character encodings and the Ruby console

      I think I should get my plugin working in SU2014 before I try to reproduce the problem. Perhaps everything will just work then.
      So please don't take this thread as a bug report. πŸ˜‰

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: [SU2014] character encodings and the Ruby console

      RB and HTML file encoding was never really a problem. But I think I ran into problems when using File Open dialogs and accessing files with special characters in the name (like umlauts). I think the Windows file system sometimes expects CP1252 encoded file names. Then there was another problem with console windows, which are encoded in CP850 or something by default on my system. I'm running some C++ programs with console windows that directly communicate with my SketchUp plugin via sockets. I have WebDialogs where the user can enter text (possibly including umlauts) which is then sent to these C++ programs and displayed in the console window. I think what I did with the console windows was changing the console encoding to CP1252 (UTF-8 is not possible I think). So I guess I'm actually down to two encodings. πŸ˜„
      What I still don't understand is how to cleanly get UTF-8 text input from the WebDialogs to Ruby. I think there's some implicit conversion going on between the two.
      I'm still in the process of converting my plugin to Ruby 2.0 so the above applies to the old version.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: [SU2014] character encodings and the Ruby console

      @tt_su said:

      (Other than it can make people thing their encoding is correct, even though it's not.)

      That's what I'm worried about, because I did have issues with encodings in the past. It's kind of annoying that Windows isn't all UTF-8. Between console windows, the file system, and WebDialogs I have to deal with at least three types of encodings.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • [SU2014] character encodings and the Ruby console

      Hi,

      I've been playing around with character encodings and noticed something in the Ruby console I don't understand. The default encoding of strings in the console seems to be UTF-8, which isn't surprising. Even if I convert a string from UTF-8 to a different encoding, it will still be printed to the console correctly. But even if I then force the encoding of the converted string back to UTF-8 (which doesn't change a single byte in the string) it will still be printed correctly to the console although now the console must think it's a UTF-8 string while it actually isn't.

      I'll attach a screen shot with an example:

      Encodings and the Ruby console

      Does anyone know what's going on here?

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: Resolution of pre-distorted textures

      Thanks for the suggestions! You're right, there's no single "tiling factor" in a distorted texture. I think I'll ignore this problem for now and solve more important issues first.

      By the way, is there perhaps some kind of exporter plugin template that does all the complicated stuff of getting the needed model information out of SketchUp? Something that's only missing the actual writing of the target file format.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • Resolution of pre-distorted textures

      Hi,

      I'm working on a model exporter plugin (to AC3D format) and I'm wondering whether there is a way to increase the resolution of pre-distorted texture files that are written by the TextureWriter for faces which have their texture distorted in such a way that the distortion can't be represented simply by UV coordinates. The problem is that the pre-distorted textures have very low resolution and look very grainy.

      Update: the problem is mostly with small tilable textures, because the TextureWriter apparently uses the original texture size when writing the pre-distorted texture. So when there's a small texture that has been tiled and distorted the written texture is pre-distorted and also pre-tiled but has the same pixel size as the original small texture.
      I think it would make more sense to increase the written texture size by the same factor with which the original texture has been tiled on a face.

      Here is an example:
      This is the original texture
      This is how it looks in SketchUp
      This is what was written by the TextureWriter
      This is how it looks in a 3D viewer

      Thanks
      Ralf

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: JSON in Ruby

      All right, I wasn't aware Yajl isn't able to work with arbitrary objects. I was only using it to encode/decode hashes with simple values and arrays.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: JSON in Ruby

      @myhand said:

      Thanks OricAtmos! Will give it a try.

      Did you get it to work? Unfortunately I've been unsuccessful in finding out where I got it from.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: JSON in Ruby

      @myhand said:

      Where did you get the library from?

      I don't remember where I got the Windows binaries from. Perhaps I still have a bookmark in my web browser at work, but right now I'm at home and can't have a look. But since I have access to our project repository from home I can offer you this:

      Link Preview Image
      Dropbox - 404

      favicon

      (dl.dropbox.com)

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: JSON in Ruby

      @myhand said:

      There is a a subdirectory called yajl, but no files named "yajl.rb", "yajl.so" or "yajl.dll" anywhere else in the yajl library distribution... So cannot see how adding the "c:/temp" path to $LOAD_PATH will find the file as it does not appear to exist.

      Sounds like you don't have the complete library.
      This is a list of files I have in my Yajl folder:

      
      [...]\rubylibs\yajl.rb
      [...]\rubylibs\yajl\1.8\yajl.so
      [...]\rubylibs\yajl\1.9\yajl.so
      [...]\rubylibs\yajl\bzip2.rb
      [...]\rubylibs\yajl\bzip2\stream_reader.rb
      [...]\rubylibs\yajl\bzip2\stream_writer.rb
      [...]\rubylibs\yajl\deflate.rb
      [...]\rubylibs\yajl\deflate\stream_reader.rb
      [...]\rubylibs\yajl\deflate\stream_writer.rb
      [...]\rubylibs\yajl\gzip.rb
      [...]\rubylibs\yajl\gzip\stream_reader.rb
      [...]\rubylibs\yajl\gzip\stream_writer.rb
      [...]\rubylibs\yajl\http_stream.rb
      [...]\rubylibs\yajl\json_gem.rb
      [...]\rubylibs\yajl\json_gem\encoding.rb
      [...]\rubylibs\yajl\json_gem\parsing.rb
      [...]\rubylibs\yajl\version.rb
      [...]\rubylibs\yajl\yajl.rb
      
      
      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: JSON in Ruby

      Dan already explained more than I could have. He also wrote a nice ruby script to include additional folders in $LOAD_PATH. Read all about it here: http://sketchucation.com/forums/viewtopic.php?f=180&t=29412&p=342471&hilit=!loadpaths

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: JSON in Ruby

      @myhand said:

      Hi OricAtmos, I tried to get this to work but keep getting errors when trying to include the library:
      [...]

      How did you install the library?

      I think it might have to do with the library search paths or something. I'll get back to you tomorrow with the details.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: JSON in Ruby

      Is there a reason to avoid libraries like Yajl, because that's what I'm using. I should note that our plugin isn't distributed in any way and only used internally so far and I just put all necessary Yajl files in a sub folder inside our plugin folder. So that's not too pretty I guess, but it works fine.

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • RE: How to get the saved file path

      Hey,

      I ran into the same problem as Nick60 today and was glad I found this thread with an nice solution.
      However there's still one use case with a problem:
      when the user saves the model with "Save copy as..." the side-car file will be saved under the wrong name.
      Any suggestions how this could be fixed?

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • Material names changed by SketchUp

      Hi,

      I have a small problem with material names. Let's say I apply a material named 'Stonewall' from one of the Material Collections in the paint bucket tool and there already is a material with this name in the model, SketchUp will rename the new material to 'Stonewall1' and add it to the model under this name. My problem is that I want to know the original name of this material, because I need to load additional information from a file named 'Stonewall.mat'. Is there a way to get the original name? I suppose there isn't but it can't hurt to ask. πŸ˜„

      Thanks
      Ralf

      posted in Developers' Forum
      OricAtmosO
      OricAtmos
    • 1
    • 2
    • 1 / 2