💡 LightUp 7.1 | SketchUp's only real-time renderer that uses object-based rendering Download Trial
  • How download and apply material from html page?

    2
    0 Votes
    2 Posts
    6k Views
    B

    I guess you have to download the file to local disk,then apply it in your model, of course, you can use ruby to do it automaticly

  • Online 3D Room Visualiser

    3
    0 Votes
    3 Posts
    6k Views
    pbacotP

    @juju said:

    I know of RoomSketcher, but I don't think it imports SKP files.

    Actually looks pretty good. May be useful for some clients

  • Ruby Operation left Open

    4
    0 Votes
    4 Posts
    6k Views
    TIGT

    Also remember that your code as we can see it ALWAYS does a commit - even if there was never an operation started.
    But since we only see some of your code it's unclear if there's always an operation to be committed !
    One way round that is initially to set **@**draw_status = false, then within the 'tests' use **@**draw_status = @model1.start_operation(@Model_operation, true) e.g. in if @Trusstype...
    Always remembering to set in each 'test':

    and then in your unshown code, for each commit you need to use:
    draw_status = @model1.commit_operation if **@**draw_status
    So you don't commit anything unless an operation is been started...

  • Python for Sketchup?

    2
    0 Votes
    2 Posts
    7k Views
    renderizaR

    Why would you want to use Python instead of Ruby?

    You can try using Python to talk to Javascript and then javascript talk to SketchUp is Ruby API.

    There is also a C API but I have never used it.

    Good luck!

  • How to detect if two faces are EXACTLY coplanar or not?

    9
    0 Votes
    9 Posts
    8k Views
    robintR

    Yeehaaa

    here's a dummy way with a tetrahedron

    fudge your model with a face on x,y plane and one edge on the x axis - you hope. this face must be filled

    draw a flat rectangle joining this edge at both end and extend along the flat plane y. It should fill by itself. the line in between can be removed and it should all fill - if not you screwed up placing your model

    I think this is fundamental to any modelling (would you start a 2d drg without an origin, scale and xy directions

    coplanarity.jpg

  • Applying color to circles?

    4
    0 Votes
    4 Posts
    5k Views
    TIGT

    Your current 'circle' code only draws some edges [all be it that they are in the form of circles].
    Use e.g.
    edges=ents.add_circle(@pt1, @vec3, @dia, 24)
    Then make a face for one of those edges...
    ents.find_faces(edges[0]) face=edges[0].faces[0]
    Then add a material to the 'face'...

    Of course this is very simplistic...
    e.g. if your circles might overlap etc not all edges might get a face, so then you probably need to make each circle/face inside its own group in turn, at least until you have finished making/painting it etc, after which exploding the temp-group can put the faces back into the desired entities-context...

  • Converting Su8 ruby 1.86 to Ruby 2

    3
    0 Votes
    3 Posts
    5k Views
    robintR

    Hi thanx for the heads up, I thoought I was probably being simplistic 🤢

    Its a pity that SUC does allow more realistic FB to developers. Some of the stuff is brill and I would give 5*

    But I am strictly on the geometric solids/eng side and SU is mainly for graphics and visualisers I guess

  • LD_LIBRARY_PATH ... call executables and dynamic libraries

    2
    0 Votes
    2 Posts
    4k Views
    Dan RathbunD

    ENV["LD_LIBRARY_PATH"] is for standalone Ruby. I'm surprised if it works at all in embedded Ruby.
    Same for Open3. I've heard of nothing but problems with it under SketchUp embedded Ruby.

    Suggest you try to wrap Emp using the Ruby Fiddle library ...
    http://ruby-doc.org/stdlib-2.2.4/libdoc/fiddle/rdoc/Fiddle/Importer.html

    P.S. - Your code is hard to read on GitHub because your indents are being replaced with 8 spaced TABs. Ruby looks best with 2 space indents. Most code editors can replace TAB with space characters as you type, and you will not get these giants indents when you post code.

  • Issues with a simple material copy raycast script

    25
    0 Votes
    25 Posts
    7k Views
    C

    Thanks again for the reply TIG. Unfortunately, I see the same issues. To verify it wasn't the small differences in faces from DropVertices, I made a copy of the bottom textured model and moved it directly above. I removed the top materials and then ran the script. UV issue is still there. Have you actually downloaded the file and run this script with the top mesh faces selected? Have you seen the UV issues or did it look okay for you? Honestly, I guess I will just give up at this point.

    I have figured out another sort of workaround where I make a sandbox mesh above the original, run this script we wrote (which does perfectly with the texture and UVs when the raycast is from a flat surface), then use UVToolkit to save the UVs, then drop the vertices and then restore the UVs. It works. A few extra steps but this script has been enough of a headache.

    Regardless, thanks for your help.

  • Undoing all transformations

    5
    0 Votes
    5 Posts
    4k Views
    F

    Thanks for all that info fredo... It'll certainly come in handy

  • GUI without decorations

    2
    0 Votes
    2 Posts
    3k Views
    fredo6F

    GUI like TopoShaper and my other plugins' are drawn in the viewport and constantly refreshed (at each view.invalidate). So this is a very different technique compared with HTML dialogs.

    Benefits:

    you can use a state driven approach, since the refresh is permanent you do not have problems of focus between the Sketchup window and the dialog box

    Drawbacks

    you have to draw everything with the OpenGL methods (i.e. view.draw2d()), and manage the interactivity with onLButtonDown, onLButtonDown and onMouseMove()). The GUI takes some real-estate on the Sketchup viewport. And also, it disappears when you Orbit or pan Some users don't like it, as it is 'non standard' (by the way, when looking at Web Sites, this difficult to say that there are standard in HTML too!)

    Note that HTML / JavaScript / CSS, you can make the programming state driven by using frameworks like Vue and Bootstrap. There is a learning curve but overall it's working fine. For the focus, this is more complex to handle, but there is a technique to force Sketchup to give back focus to itself.

    Fredo

  • How do I find a problematic Sketchup Material?

    16
    0 Votes
    16 Posts
    10k Views
    S

    I had a similar problem where I are getting this message every time I tried to save: "*** Problems were found that could not be fixed! *** The name for CMaterial (290526) is not valid". It would still let me save the file though. I was able to solve the problem by opening the materials window and hovering over each material to look at the name. I found 3 materials that somehow had blank names. After renaming those materials the problem went away.

    I don't know how those blank named materials got there in the first place though, I tried to recreate the problem but SketchUp won't let you name a material with a blank name.

  • Definitions.load_from_url failing when called from an HTMLDi

    3
    0 Votes
    3 Posts
    3k Views
    G

    It worked wonderfully! I was using the load_from_url method with a file:// prefix before, and it also worked... but this makes more sense.

    Thanks!

  • Shadow Control Possible? (solved)

    10
    0 Votes
    10 Posts
    6k Views
    M

    dude, did you know that everytime you save a scene there is the option to save it with the current settings? Maybe this wasn't the case back in 2013 but there you go

  • SKM files and the API

    5
    0 Votes
    5 Posts
    3k Views
    medeekM

    Most users of the plugin are SU 2018 but I've received some kickback from others so I may have to put this plan on hold and go a different direction.

  • Set the last column of a Geom::Transformation

    2
    0 Votes
    2 Posts
    3k Views
    F

    You may find information on this in:

    "Automatic SketchUp - Creating 3-D Models in Ruby"
    by Mathew Scarpino
    Permissions may be sought directly from Eclipse Engineering LLC:
    Fax: (925) 262-1757
    E-mail: info@eclipseengineer.com

    Appendix B: Advanced Geometry..................................... 391
    B.3 Introduction to Transformation Matrices .........................................406
    B.4 Combinations of Transformations...................................................415
    B.5 Transforming Points and Vectors....................................................418
    B.6 Mathematics of Combining Transformations....................................423

    You may find helpful links here:
    http://sketchucation.com/forums/viewtopic.php?f=180&t=10142&p=573943&hilit=automatic+sketchup#p269709

  • [Obsolete] Offset On Surface (v1.0)

    48
    0 Votes
    48 Posts
    25k Views
    fredo6F

    @einstein said:

    Hi!

    I know, it's a dusted thread but maybe someone will make me know.

    Is it possible that Offset on Surface would treat separately several neighbouring surfaces selected at one time? I mean, instead of creating one big offset from selection border, it would make several offsets, each out of one surface separately.

    Not sure I understand. Could you be more precise or give a concrete example.

    Fredo

    PS: you can use the Thread of ToolsOnSurface, or start a new discussion thread for this subject.

  • Ruby command to rotate or move on axis.

    2
    0 Votes
    2 Posts
    3k Views
    S

    That sort of thing is done with a Transformation. Look up Transformation in the SketchUp Ruby API documentation.

  • Triangle orientation

    3
    0 Votes
    3 Posts
    3k Views
    IltisI

    Thank you very much for this explanation and for the special case.
    It helps a lot.

  • Combining components into 1 component

    6
    0 Votes
    6 Posts
    3k Views
    K

    Thanks Mitch your code worked very well once I figured out the transformation I needed. The code also left the component entities on Layer0 which was a problem for my code.

    The forum is an amazing source of info thanks to the many people who are willing to share their knowledge.

    Keith

Advertisement