sketchucation logo sketchucation
    • Login
    1. Home
    2. MarcioAB
    3. Posts
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 12
    • Posts 50
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Vectors?

      @thomthom said:

      Can anyone elaborate ...

      Suppose you have 3 points (p1, p2, p3) and want a point (p4) "normal" to p1. The 3 points define the PLANE and also 2 vectors with origin in p1.

      If you make a CROSS PRODUCT between those 2 vectors, you will get a 3rd vector that is NORMAL to the PLANE and passing on p1. If you offset p1 using this new vector ... voila!

      Example:

      p1 = Geom::Point3d.new(1,2,3) (can be any 3d point, non hard coded)
      p2 = Geom::Point3d.new(4,5,6)
      p3 = Geom::Point3d.new(7,8,9)

      v1=p2-p1 or v1=p1.vector_to(p2)
      v2=p3-p1 or v2=p1.vector_to(p3)

      p4 = p1.offset(v1v2)
      or
      p4 = p1.offset((p2-p1)
      (p3-p1))

      Regards
      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • RE: SketchUp RUBY API Wishlist [way of coding wishes, please]

      Access to Model.open ( open method of Model class ) as presented in this topic1 and this topic2.

      Thank you

      posted in Developers' Forum
      M
      MarcioAB
    • [Wishlist] Edit Component

      There is a close_active method in Model class to close an opened instance of a component.
      An active_path method in Model class to show the parents of an instance of a component.
      A trick to open (edit) a component in this topic
      A private open method in Model class probably to open (edit) an instance of a component ...

      Why this private open method is not made public ? (or why not a method to open (edit) an instance of a component?).

      Obs: must be the instance, because the open (Edit Component) allows access to the positioning of that particular instance.

      Thank you
      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • RE: [Plugin] JointSU (in drafting)

      Thank you.

      1. The comments for now are in Portuguese, but I will translate them to bad-English (the most spoken language in the world!) as soon as I have a less draft-code version.

      2. The idea to publish an early-draft was to get some inputs/suggestions on how a Joints-oriented modeling should be (but the draft-code is now so messed up that I can not even upload the improvements made since this early draft).

      3. These JointSU must work 100% in companion with the Model Structure ( or OUTLINER ... strange name for something so important ). Working on that now.

      4. Two things are blocking me to advance these days: (1) my full time job and (2) I can not find a way to OPEN a component. The Sketchup::Model.open method is there but it's private (and not public). Example:

      p Sketchup.active_model.open
      Error; #<NoMethodError; private method `open' called for #<Sketchup;;Model;0x4a28e70>>
      

      Any help on that will be very welcome.

      Regards
      Marcio

      posted in Plugins
      M
      MarcioAB
    • [HowTo?] Edit Components (or change &quot;active level&quot;)

      Now, on SU7, that one can get the full "genealogical instances path" from your current "active level" up to the model level ( with model.active_path ).
      How can I re-position my "active level" in one particular instance of this path (kind of "edit level") ? Example:

      print model.active_path
      #Sketchup::ComponentInstance:0x01Sketchup::ComponentInstance:0x02Sketchup::ComponentInstance:0x03

      That means my current "active level" is instance 0x03.
      How can I move up one level using Ruby API to make my "active level" at instance 0x02 ?

      Thank you

      PS1: It could be a pair of APIs like this:

      model.get_active_path ( exactly the same as model.active_path)
      model.set_active_path(n) where n is the number of "levels" to go up.

      In the example above, model.set_active_path(1) will move the "active level" to
      #Sketchup::ComponentInstance:0x01Sketchup::ComponentInstance:0x02

      PS2: Today I'm using the OUTLINER to get positioned in a particular "active level". How can I do the same using Ruby API ?

      Thank you
      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • RE: [HowTo?] Find Instance parent's Instances

      That is exactly what I was looking for !

      Thank you
      Marcio

      Obs: A new documentation for SU7 Ruby APIs could be nice. It could be a kind of open Wiki so we all could help improve it, as write documentation is ... boring.

      posted in Developers' Forum
      M
      MarcioAB
    • RE: Math functions and SU7

      Without "include Math" statement (directly from Ruby's console or from any autoloaded plugin), it does not work here. With "Math included", it works fine.

      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • RE: [HowTo?] Find Instance parent's Instances

      Hi Didier, maybe I'm misunderstanding how SketchUP works. Please let me explain how I get it with a bike example:

      [ComponentInstance][ComponentDefinition] <Instance Name> <Definition Name>

      [0x11][0x01] <my><Bike>
      [0x12][0x02] - <Front><Fork>
      [0x13][0x03] - - <this><Wheel> .... front wheel
      [0x14][0x02] - <Rear><Fork>
      [0x13][0x03] - - <this><Wheel> .... rear wheel

      Suppose I select the front wheel instance. Its parent is ComponentInstance:0x12.

      How can I discover that the front fork (ComponentInstance:0x12) is the parent of front wheel and not the rear fork (ComponentInstance:0x14) ?

      Thank you

      posted in Developers' Forum
      M
      MarcioAB
    • [HowTo?] Find Instance parent's Instances

      Is there any API to find the parent ComponentInstance of a ComponentInstance ? (or any trick code for that?).

      Reading the documentation for entity.parent (below) I wonder why the parent method of a ComponentInstance give back the definition of its parent's Instance. If the parent method give back it's ComponentInstance (and not its parent's Definition), if one needs that parent definition it should just ask for parent.Definition.

      Am I missing something ? Is the part of the documentation that talks about "the future" addressing that ?

      Thank you.

      *parent

      The parent method is used to retrieve the parent entity of the entity. Think of the whole SketchUp model as a "Component Definition", just as you can import a .skp model as a component into another .skp model. Such is this reference. If an entity belongs to the top level model.entities list, then its parent with be the "Model". A Component Instance will have as its parent a Component Definition. An entity within a Group will also have as its parent a Component Definition. In the future, there may be a new "container" that more accurately describes an entities "container".*

      posted in Developers' Forum
      M
      MarcioAB
    • RE: Product/Component Structure Browser

      Perfect! Thank you.

      posted in Plugins
      M
      MarcioAB
    • Product/Component Structure Browser

      I'm scanning this forum looking for something that could be called as "Product or Components Structure Browser" but I was not able to find. As I need this functionality I'm working on that (see picture below), but I fell I'm inventing "the wheel".

      Can someone help me pointing where I can find something similar ?

      The idea is to have a tree-organized browser of the components and from there be able to select (and than handle) the component in the model, as in the picture below.
      Image2.png
      Thank you
      Marcio

      posted in Plugins
      M
      MarcioAB
    • RE: [Plugin] JointSU (in drafting)

      @yannleo said:

      not easy to control the orientation up to now.

      Yes. That's why the proposed "JointSU" now has the shape below:

      Image1.pngWith these 3 planes, it's easier to use the tool to position the joints. I also included a panel to define the size of the JointSU.

      @yannleo said:

      The ideal of using component as a "joint" to line up objects is promising.

      Yes. The idea is to create an "hierarchical component browser" to view/handle how components/joints are structured. Working on that ...

      Regards
      Marcio

      posted in Plugins
      M
      MarcioAB
    • [Plugin] JointSU (in drafting)

      This is a draft plugin to handle JOINTS in SketchUP components.

      [flash=425,344:3v9k7zws]http://www.youtube.com/v/VQrZSiRBVeY[/flash:3v9k7zws]

      Add some "joints" (see below how) in standard components to make then "joint-enabled" and:

      1. Select 1st "joint-enabled" component.
      2. Select 2nd "joint-enabled" component.
      3. Shift-click in one of them. This one will remain fix and the other will align Joint-Joint.

      To make any component "joint-enabled", just include one or more joint-components ("JointSU") in it.

      Use the menu to create the "JointSU" component or create one by yourself.
      Nothing special with this component. Just the name that must be "JointSU". The transformations use the default axis of the component. The proposed geometry has 2 faces to easy positioning.

      obs:

      1: If the "joint-enabled" component has more than one joint, click the component to select the next joint.
      2: After the move, click on any component to rotate the moved component 90 degress in X or Shift-click to rotate it 90 degrees in Z.
      3. Menu Plugins/JointSU:
      3.1 - Create the JointSU component ("Create JointSU component")
      3.2 - Hide/Unhide the joints ("Hide all JointSU" or "Visible all JointSU")

      JointSU.zip

      Comments and suggestions are welcome.

      Regards
      Marcio

      posted in Plugins
      M
      MarcioAB
    • RE: [Plugin] Camera OrbitOnTarget v1

      Well, this is how it works here:
      [flash=425,350:1ajsikpg]http://www.youtube.com/v/IWx026cl23s[/flash:1ajsikpg]

      But I also tried to capture the video-screen with MS Windows Media 9 Encoder and the behavior became more or less like you mention. But I do not know how to fix this.

      posted in Plugins
      M
      MarcioAB
    • RE: [Plugin] Camera OrbitOnTarget v1

      @edson said:

      i tried it on my macbook and it did not work. the tool bar is there and after i clicked twice on an object a dot appeared on it but other than that nothing happened.

      Humm ... I do not have a Mac to check but, just to see if the sequence is the expected one:

      1. Select the tool (on the bottom text bar there should appear short instructions). This is just to see if the tool was correctly loaded.
        You will also see the Inference-point around. Just move the mouse to see if the Inference-point move around the elements.

      2. Then double-click. The screen must re-center. (try a point that in not too close the center, but even with a minimal distance it's easy to see something happened with the screen)

      Could you double-check that please ?

      Also, there is a variation of this plugin for change the position of Components (in draft).
      http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=14193#p107373

      Abracos
      Marcio

      posted in Plugins
      M
      MarcioAB
    • RE: Idea for an Orbit tool focused on single object

      Well, may be this (reused code) is more closer to what you will be talking about:

      Here is an initial version of +1 product from OrbitOnTarget Line of Products (hehe πŸ˜„ )
      Later I will write a better "manual", but in the mean time ...

      1. Select Component(s).

      2. Select the Tool (Component OrbitOnTarget)

      3. Select a Reference point (with double-click and no feedback for now) - this is used to Move the selected Compo(s) in a radial direction, closer of more distance relative the Target.

      4. Select the Target point (with double-click and no feedback for now) - this is used to Rotate the selected Compo(s) relative the Target.

      5. LButton-down + drag to move the selected Compo(s).

      6. LButton-down + Shift + drag (up/down) to move the selected Compo(s) more closer or distant the Target (up= +closer, down= +distant).

      Both OOT: Camera and Component OrbitOnTarget. Give a try and let's see how to improve them.

      OOT.zip

      The ComponentOOT can be much more improved toward the concept of Connectors. For now this is a initial concept for the Point-to-Point connector (Reference-to-Target).

      It's also necessary a roll-back mechanism to undo, etc, etc but looks promissing.

      Regard,
      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • RE: Idea for an Orbit tool focused on single object

      **@malaise said:

      Really curious about the way you make that plugin.
      Maybe could you insert some comments in the ruby file.
      Thanks Marcio πŸ‘ πŸ‘
      MALAISE**

      OrbitOnTarget.png
      Initial understanding: SketchUP camera has 3 main components: Eye, Target and Up (vector). We need one more component: @target, that is the point that will be fixed.
      So, now we have:

      @target -> the fixed point and center of the 2 transformations (see below)
      camera.eye -> remain camera.eye
      camera.target associated with @center
      camera.up associated with vetorT
      VetorH is an auxiliar component (explain later why)

      So centered in @target the other 3 components (@center, VetorT, camera.eye) must receive 2 transformations:

      • Horizontal transformation around Z-axis
      • Vertical transformation around vetorN (that is normal to vetorH both in horizontal plan)

      The amount of these transformations (deltaV and deltaH) came from the mouse drags.

      VetorH could be calculated (by projection of camera.eye on the horizontal plane), but gets complicated when the camera is passing over the poles. So, it's necessary to keep this vetorH just for that.

      Let me know where I should provide more details.

      Regards
      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • RE: Idea for an Orbit tool focused on single object

      **@malaise said:

      Hi, All
      What I want to mean about my idea, is an orbit-like tool only apply to selected object(s) πŸ˜•
      **
      I see your point. Yes, easy components re-position is also in my wish list. Initially I was considering to see if it's possible to create "connectors" to that (like point-point contact, point-face contact, etc). But reuse "OrbitOnTarget" code to a new tool to re-position one or more components should not be that difficult.

      posted in Developers' Forum
      M
      MarcioAB
    • RE: [Plugin] Camera OrbitOnTarget v1

      **@watkins said:

      Dear Marcio,
      I already have a folder called Icons in my Plugin directory (upper case i). Could you rename your folder something like icons_OOT to distinguish your icons from those for other scripts?
      Regards,
      Bob**
      Sure Bob. In the mean time, if you wish to change Ruby code, could you please go to lines 144 and 145 and replace then from:

      From:
      cmd.small_icon = "icons/target_16.png"
      cmd.large_icon = "icons/target_24.png"
      To:
      cmd.small_icon = "icons_OOT/target_16.png"
      cmd.large_icon = "icons_OOT/target_24.png"

      Thanks

      posted in Plugins
      M
      MarcioAB
    • RE: Idea for an Orbit tool focused on single object

      Humm ... what a coincidence. Please, take a look at this post I just created:

      http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=14198

      But instead "target" (or focuse) on the center of gravity of the component(s) I think target a specific point (using the wonderful inference engine) seems to be more appropriate for precise work. Give a try on OrbitOnTarget ...

      posted in Developers' Forum
      M
      MarcioAB
    • 1
    • 2
    • 3
    • 2 / 3