sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    A bunch of Ruby questions

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 245 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      cjthompson
      last edited by

      Well, I have a bunch of questions, so instead of doing a bunch of different topics, I decided to just do one.

      Is there any way to find the opposite face of a rectangular block without using a raytest?

      Is it better to add a group to a component and draw new entities inside or better to draw the entities and then group them?

      Is there any way to change the axis of a component without using transformations?

      Can you tell whether a part is drawn by the component axes or global?

      Is there a way to dynamically change the face an entity is drawn on?

      Can you get the global location of a component without using BoundingBox?

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Hi Chris,

        @cjthompson said:

        Well, I have a bunch of questions, so instead of doing a bunch of different topics, I decided to just do one.

        Is there any way to find the opposite face of a rectangular block without using a raytest?

        You could maybe compare the direction of the face's normals.

        @unknownuser said:

        Is it better to add a group to a component and draw new entities inside or better to draw the entities and then group them?

        The API docs say it is preferable to create an empty group and then add to it. If the entities do not already exist, go ahead and create the group first.

        @unknownuser said:

        Is there any way to change the axis of a component without using transformations?

        No. You would need to redraw around the desired axes.

        @unknownuser said:

        Can you tell whether a part is drawn by the component axes or global?
        Is there a way to dynamically change the face an entity is drawn on?

        Not sure what you mean.

        @unknownuser said:

        Can you get the global location of a component without using BoundingBox?

        Yes, instance.transformation.origin will give you the location.

        Hi

        1 Reply Last reply Reply Quote 0
        • C Offline
          cjthompson
          last edited by

          thanks for the quick responses.

          to clarify the question about adding the entity to faces dynamically, I was wondering if it is possible to place an entity on a face in 2 dimensions, disregarding depth, and still be able to reference it in 3 dimensions.

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @cjthompson said:

            Is there any way to find the opposite face of a rectangular block without using a raytest?

            I made a function in my Selection Toys plugin that selects the opposite face. Doesn't use ray testing though. I lops over the connected geometry and finds the nearest opposite face. You can poke around in the code for that if you like.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement