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

    Topics

    • B

      Group moves to origin when I doubleclick to select component

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      20
      0 Votes
      20 Posts
      863 Views
      Dan RathbunD
      @tt_su said: But you cannot return a single world position for a vertex unless you have some extra info. RIGHT.. I gotcha' We would need to let Ruby know the parent instance's transform. (Not automatic unless in user edit mode.) I guess we can do this now. We just create a copy of the instance's transformation, call it **t**: world_pt = edge.start.position.transform(t) I guess I was pondering how to automatically call #transform(t) upon all newly created Geom::Point3d instances, within a code block scope. So, yes I suppose an optional "tranform" class argument for Vertex#position would be handy. (It could be a Geom::Transformation instance, a Geom::Vector3d in world context, OR either an Array or Geom::Point3d offset from ORIGIN.) So it could look like: world_pt = edge.start.position(t) (2) So lets say you have collected a series of vertices (in an array verts.) And you want their world co-ordinates: world_pts = verts.map {|v| v.postion(t) } We have to use map, because the API's Array#tranform() and Array#tranform!() methods, refuse to apply a transform to an array with anything other than than 3 numerics. Even though each individual element has a transform method. Example, you have an array of Geom::Point3d objects, and you want to transform ALL elements the same. The Array class transform methods should do this IF the the elements are not numeric, and they respond_to?(:transform). (Add: Any element that does not "respond_to" is returned unchanged.))
    • B

      Is the ruby source for rectangle tool or similar available?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      209 Views
      TIGT
      There are several 'rectangle' plugins available, like '3 point rectangle' ... My own 2Dtools includes a 'rectangle tool' making 4 edges - no face... The principal is very similar to the line-tool example, instead of picking 2 points, you pick 3. The 'box' tool also has a potential crib... Point 1 click = p1 the start of an edge Point 2 click = p2 the end of that edge A Vector - vec = p1.vector_to(p2) Point 3 click - poff - this defines the offset to the opposite side NOT a vertex. A Line - line = [poff, vec] Project p1 & p2 to line p3 = p2.project_to_line(line) p4 = p1.project_to_line(line) Now if you want a face: face = Sketchup.active_model.active_entities.add_face(p1, p2, p3, p4) The edges get automatically added. If you want just edges: edges = Sketchup.active_model.active_entities.add_edges(p1, p2, p3, p4, p1) Remember to close the loop by reusing the first point again at the end... ***To get the temporary graphics rubber-banding that is needed in 'draw'... use the initial 2 points as if it's the line-tool, and then after the stare increments... while waiting for the 'poff' click the mouse's cursor-position can be used for calculating the the dynamically changing projected points from those 2, to draw the four sides of the potential rectangle as the cursor moves...
    • B

      How do I represent and keep a track of cuboids I create?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      570 Views
      Dan RathbunD
      @bobdiya said: But given that the user is likely to rotate the cube (<90 degree off the global axis) ... Because now the default bounding boxes are larger and they don't represent the bounds of the cube themselves. Correct? True. @bobdiya said: ... then I will have to create and keep references to the bounding boxes? BUT then THOSE bounding boxes are not rotated,... their corners do not occupy the same vertices points that the cuboids do. Meaning that cubiods could have been rotate away from each other... so as not to be intersecting after rotation.
    • B

      Can I override the basic functionality of pushpull?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      425 Views
      B
      Apologies for the delayed response. Here is how a user would use the Plytool (the tool that creates a box/ply) Click on the tool icon. Now click (to mark the first point) and start drawing the ply [image: YZwl_1.png] Stop at another point (which is the second point). Leg go the left click and you have your ply [image: DK4W_2.png] Coming to the questions @tig said: From what you've said you don't actually want to stop the user having the PlushPull tool available to them ? Correct. I don't want to stop the user from using Push/pull but just restrict the user from pushing or pulling on certain kind of faces [e.g - vertical faces only]. @tig said: Limiting the user's choice within your tool of available faces for this pushpulling is a matter of testing a face for its suitability - this can be whatever you want - orientation of face.normal [e.g. only 'up' faces], or faces using a particular material or layer ? That way your own pushpull tool will simply work in limited ways... Yes, this seems like the suitable option to try. I will try this and get back if any questions. Ideally I would have preferred the ability to override pushpull tool (thereby not introducing a new limited version of pushpull tool). But this should do for now. Thanks guys for helping me out and clarifying what is possible and what not.
    • 1 / 1