sketchucation logo sketchucation
    • Login
    1. Home
    2. bentleykfrog
    3. Posts
    ⚠️ Attention | Having issues with Sketchucation Tools 5? Report Here
    B
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 84
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Collision Code Optimization

      @adamb said:

      Using the raytest functionality to add some nice "clash detection" when placing a Components is one thing. Resolving general interpenetration using some iterative convergence is another, requiring 100x / 1000x more performance.

      I see your point Adam, thanks πŸ˜„ Its looking like I'll have to keep this very basic, with only one large raytest representing the point and vector of the camera. If raytest is affected by the large FOV clipping issue I'll have to apply some modifications based on the FOV and the angle between the cross of [the face normal and camera vector] and the camera vector. I'll have to translate the camera movement to the cross of the face normal and camera as well. If anything complex happens after this in the same frame the movement will need to stop dead to preserve the frame rate.

      thanks

      -niall

      posted in Developers' Forum
      B
      bentleykfrog
    • Collision Code Optimization

      I've been doing some speed tests to model some collision 'physics' in sketchup and found these methods interesting. My collision model is based on 6 vertices projected out of the camera point to detect surrounding objects (to save overhead). The total time I was aiming for was below 0.04 seconds to produce a decent frame rate. I started out with this script using view.inputpoint to guess the target. Its a translation of guess_target from the Film & Stage Plugin(camera.rb);

      Sketchup.active_model.start_operation("collision",true); 
      view = Sketchup.active_model.active_view; 
      t=Time.now; 
      eye = view.camera.eye; 
      10.times { 
        target = Geom;;Point3d.new(rand(10),rand(10),rand(10)); 
        view.camera.set(eye, target, Geom;;Vector3d.new(0,0,1)); 
        center_pt = view.center; 
        input_point = view.inputpoint center_pt.x, center_pt.y;
      }; 
      puts Time.now - t; 
      Sketchup.active_model.abort_operation;
      

      This produced on average over 10 iterations of 0.4136 seconds.

      I compared this with the raytest method which removed the need to update the camera:

      Sketchup.active_model.start_operation("collision",true); 
      view = Sketchup.active_model.active_view; 
      t=Time.now; 
      eye = view.camera.eye; 
      up = Geom;;Vector3d.new(0,0,1); 
      10.times { 
        target = Geom;;Point3d.new(rand(10),rand(10),rand(10)); 
        ray = [eye, (eye.vector_to target)]; 
        result = Sketchup.active_model.raytest( ray ); 
      }; 
      puts Time.now - t; 
      Sketchup.active_model.abort_operation;
      

      This produced an average over 10 iterations of 0.1395 seconds.

      I also noted that setting the second variable of raytest to false saves some more time. setting raytest to (ray,false) produced an average of 0.1363 seconds.

      Since its a collision test, we've got a maximum distance that the collision 'physics' will cut in at, so we don't need to get any points beyond this. So performing raytest beyond this set distance to get a 3d point would be pointless. So I thought setting a maximum raytest distance by writing lines along each ray at this distance would stop raytest in its tracks. So this is what the script below does:

      Sketchup.active_model.start_operation("collision",true); 
      entities = Sketchup.active_model.active_entities;
      group = entities.add_group;
      entities = group.entities;
      view = Sketchup.active_model.active_view; 
      t=Time.now; 
      eye = view.camera.eye;
      up = Geom;;Vector3d.new(0,0,1);
      10.times {
        target_vector = Geom;;Vector3d.new(1+rand(10),1+rand(10),1+rand(10));
        target = eye + target_vector;
        vector = eye.vector_to target;
        vector.reverse!;
        vector.normalize!;
        target2 = target + vector;
        line = entities.add_line target,target2;
        ray = [eye, target_vector];
        result = Sketchup.active_model.raytest(ray,false);
      }; 
      puts Time.now - t;
      Sketchup.active_model.abort_operation;
      

      This produced an average of 0.0219 seconds when in clear space, and an average of 0.1382 when close to an entity.

      Its still a massive difference between each, and since the first only intersects with vertices, there's probably some large overhead when getting an intersection on a face? I could use this to simulate dead collisions, but any bouncing or parallel strafing would be quite slow.

      Anybody got any suggestions or experience with the matter? I'm at a bit of a dead end.

      -niall

      posted in Developers' Forum
      B
      bentleykfrog
    • RE: [Plugin] Camera Recorder (Pixero update)

      Nice work, haven't tested it yet but this script deserved an update, and the vertex editing options sound quite awesome to say the least.

      posted in Plugins
      B
      bentleykfrog
    • RE: Preview - Sketchup Floating Camera [Update 2011-03-19]]

      @bentleykfrog said:

      @solo said:

      Looks like a very promising plugin.

      Any chance of including a roll feature?

      Roll would be pretty cool, but i'll have to look into some new keyboard assignments for this. Is there a way of disabling the user set keyboard shortcuts when within a tool?

      A quick search reveals that its not possible 😒 I'll have to toggle some keyboard layouts on and off to do this or use some keycodes as in this: http://forums.sketchucation.com/viewtopic.php?f=180&t=34002

      posted in Plugins
      B
      bentleykfrog
    • RE: Preview - Sketchup Floating Camera [Update 2011-03-19]]

      @krisidious said:

      looks pretty cool... nice model too.

      Thanks Krisidious, the models about 2 months of hard work so I'm trying to get as much use out of it as possible πŸ˜‰

      posted in Plugins
      B
      bentleykfrog
    • RE: Preview - Sketchup Floating Camera [Update 2011-03-19]]

      @solo said:

      Looks like a very promising plugin.

      Any chance of including a roll feature?

      Roll would be pretty cool, but i'll have to look into some new keyboard assignments for this. Is there a way of disabling the user set keyboard shortcuts when within a tool?

      posted in Plugins
      B
      bentleykfrog
    • RE: Preview - Sketchup Floating Camera [Update 2011-03-19]]

      @chris fullmer said:

      I'd like for it to be able to keep a specified distance above the ground. I know there possible problems involved of it jumping up and down over objects, but I think the good would outweigh the bad.

      Chris

      Nice idea, I like this, and I think it would be quite useful to get a better walkthrough experience especially since most models in sketchup are designed with the human body in mind, and humans can't exactly float in the air.

      I think applying a set height should be easy, I just need to work out a vector distance from the camera point directly down to any intersecting faces and toggle this on and off when an intersection is found. I think, though, this might not work without camera collision, otherwise you might end up in some tricky situations underneath stairs. I'll look into this further.

      PS. I should've mentioned that I used Camera Recorder to produce the youtube clip, sorry Chris, will edit to say so.

      posted in Plugins
      B
      bentleykfrog
    • Preview - Sketchup Floating Camera [Update 2011-03-19]]

      Edit (2011-10-15): Public beta released
      Hi all, you can test the latest public beta of Floating Camera at Floating Camera Public Beta 1.x Thread.

      Morning All,

      This week I've been working on a plugin that enables a different set of movements on the sketchup camera. Its very untested in its current state so I'm not so confident to release it, but below I've added a video of it in action. The current controls are:

      Leftmouse + drag: controls the direction of the camera
      Up/Down/Left/Right: moves the camera forward and back (parallel to the camera direction) and left and right (perpendicular to the camera direction)
      Home/End: Moves the camera up and down (perpendicular to the camera direction)
      Shift/Control: Adjusts the FOV of the camera

      [flash=800,480:1lybcohb]http://www.youtube.com/v/q1N7ywPCMOw&fs=1[/flash:1lybcohb]
      Edit: I used Chris Fullmer's Camera Recorder to record the path of the camera to produce this animation.

      You'll have to forgive the unusual keyboard layout as these are the only sketchup key constants I'm comfortable will work with the plugin. I'm writing it alongside some input remappers for the 5th/6th gen console controllers so the unusual keyboard layout can be rewired.

      Currently I'm working on a Turbo feature that will speed up the camera's velocity whilst also adjusting the FOV for that almost cliche gears of war/mass effect type running effect, and I'm also adding some modifiers to control the camera inertia(friction really), camera speed, and toggle keys.

      I'd like to know what camera movements you guys think are lacking from Sketchup? And if you're interested, what changes you'd make to the features I've currently got.

      thanks for your time
      -niall

      Update 27-02-2011

      Afternoon All,

      I've been hard at work on the Floating Camera for the last week, focusing on Camera Collision, Gravity (maintaining eye height), Camera Roll & FOV changes and User Customisation in controls and the camera settings. Its been a very long week! πŸ˜„ Below is a rough draft showing off the camera features I've been working on. At the end there is also an example of Floating Camera -> Camera Recorder work flow.

      [flash=800,480:1lybcohb]http://www.youtube.com/v/vh-BOHdcK_Y[/flash:1lybcohb]

      There's still some bugs to work out before the release, and I need to reduce its load on the computer to an acceptable level. A beta release shouldn't be far off though. πŸ˜„

      The features not shown include:

      • Look customisation (finite|infinite rotation)
      • Look x & y sensitivity
      • Maximum speed
      • Camera Inertia
      • Collision Buffer Zone
      • Lock vertical movements
      • Maintain Camera Upright
      • User customisable controls

      Update 19-03-2011

      Morning again.

      Here's a quick video demonstrating the current local build's settings dialog and navigation around a very tight model (Le Corbusier's Villa Savoye by Robert-34000 on the 3d Warehouse).

      [flash=800,480:1lybcohb]http://www.youtube.com/v/fXncZU60Ftc[/flash:1lybcohb]

      I've got to apologise for the lateness of the updates. Working on the load instructor mixin for the tool has delayed the release somewhat, and I've got some uni studies to focus on in the meantime. It looks like I'll have about 2-3 more weeks before I can return my focus to this plugin. I hope that I get some free time sooner rather than later and that Google don't release a similar plugin in the meantime πŸ˜‰

      -niall

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Camera Recorder v1.7.2 UPDATED May 23, 2013

      Hi Chris,

      This plugin is beautiful, especially the scene creation and curve creation as these make it possible for integration with other animation plugins like flightpath. However I think I noticed that on my first export that the field of view changes from what is currently set in sketchup to Sketchups default 30 degree FOV? Is it possible to conserve the field of view, as I prefer to have a more natural 55-70 degree FOV.

      thanks again

      -niall

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin][$] Vertex Tools

      @thomthom said:

      Yes - that is in fact on my todo list for a future release. πŸ˜„

      I'm modelling it after how 3D Studio do soft selection. From what I can tell it is a bezier curve controlled by two paramters, Pinch and Bubble.

      Another awesome tool thomthom. I'll post some examples when I've finished my current WIP.

      wrt soft selection, would it be possible to incorporate a negative radius? that would soften the vertices only by the vertices selected rather than a soften by vertices surrounding the current selection? I ask this because there are certain vertices on the edges of my mesh that I don't want to move, but its hard to get a good soft sine wave from a selection that doesn't affect some of the vertices on this edge.

      thanks again.

      -niall

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Edge Tools

      @thomthom said:

      @bentleykfrog said:

      Awesome toolset, would be nice if divide faces preserved the edges soft, smooth and hidden properties though.

      thanks thomthom

      Good idea. I have an update coming up very shortly. Though it won't make it for that, but I'll be on my todo list. πŸ‘

      I'm in love with close gaps! It saves me so much time repairing 3d warehouse models.

      Ohh and I just thought of something else for divide faces. It would be cool if it could snap to previously entered distances, like the line or move tool does.

      thanks again for your hard work thomthom

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Edge Tools

      Awesome toolset, would be nice if divide faces preserved the edges soft, smooth and hidden properties though.

      thanks thomthom

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Component Stringer UPDATED May 23, 2013

      Nice plugin Chris, would love to see an option to use the tangent of the two edges at the node rather than perpendicular to one edge

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] SketchyFFD (Classic)

      excellent plugin! this combined with soapskinbubble and the sandbox make life in sketchup so much easier

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Very fast texture writer

      @jason_maranto said:

      Outstanding! -- this makes creating and updating material libraries so much easier.

      Best,
      Jason.

      Thanks Jason πŸ˜„

      I'm thinking of adding some proportion options on import to the next update. For example, you export some textures that aren't tiling well, batch process them through some texture tiling application, and then import the new textures and modify the proportions of the materials to suit...Maybe some options like:

      [If Different, Fit Proportions] - fits the new texture inside the width and height of the material dimensions
      [If Different, Preseve Proportions] - stretches the new texture to fit the material dimensions
      [If Different, Respect Width] - Matches the width dimension and scales the height dimension to suit the new texture
      [If Different, Respect Height] - Matches the height dimension and scales the width dimension to suit the new texture

      What do you think?

      -niall

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Very fast texture writer

      @alexmozg said:

      It is better to create an empty group, rather than create face and then remove its edges

      Nice idea AlexMozg, thanks for the code. I've updated the script to do this. I've also noticed the more times the operations are run, the slower the response from tw.write. I'm not exactly sure whats going on here but it seems if you re-open your file the lag goes away. Anyway, follow the link Very Fast Texture Writer v0.41

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Very fast texture writer

      Nice plugin Didier and takesh,

      I've modified it slightly to allow for batch processing and updating of textures.

      Update - January 15th 2011
      This is a minor update to change the entity used to create a texture to a group. This limits any interference with the models geometry on export & import (thanks to AlexMozg for the code).

      A description of all the operations are below. The plugin can be accessed by the menu [Plugins] - [Export All Textures]:

      • [Export All Textures]

      • This operation will export all the textures from the model to a 'textures' folder in the same directory as the model

      • [Export Settings] - [Update Model's Texture Paths]

      • When exporting textures with this option enabled, each texture path in the model will be updated to the path of the exported texture image.

      • [Import All Textures]

      • Choose a file within a folder to import all the textures in that folder. Each file is compared with the models textures by its namespace (ie. the file "AsphaltCloseups00212M.jpg" will be replaced with the file "AsphaltCloseups00212M" regardless of its extension)

      • [Import Settings] - [Only Update Existing Materials]

      • With this option enabled, only files with namespace equivalents to the models textured materials will be imported.

      • [Import Settings] - [Create New Materials for Unique Textures]

      • With this option enabled, files that have no namespace equivalents to the models textured materials will be imported into a new material.

      • [Import Settings] - [Create New Materials for All Textures]

      • With this option enabled, each texture file will be imported into a new material.

      • [Import Settings] - [Consolidate to Texture Folder]

      • With this option enabled, each texture file will be copied to the 'texture' folder.

      • [Export From Selection]

      • Only textures in the active selection will be exported to the 'texture' folder

      • [Import To Selection]

      • Only textures that have a match to the active selection's materials will be imported.

      • [Selection Settings] - [Make Painted Components Unique]

      • With this option selected, painted components in the selection that aren't unique to the selection will be made unique.

      • [Selection Settings] - [Materials Unique to Selection]

      • With this option selected, materials that aren't unique to the selection will be made unique. (ie. a duplicate of the material is made and all entities in the selection are linked to this duplicate)

      • [Selection Settings] - [Consolidate to Texture Folder on Import]

      • With this option selected, all imported textures will be copied to the 'texture' folder.

      I haven't been able to replicate your exporting issues takesh, could you link me to an example?

      Also, I haven't tested this on a mac, so there could be further issues.

      Changelog

      • 15th January 2011 (v0.41)

      • Face->Group Change: Changed the entity used to create a texture file to a group (thanks to AlexMozg)

      • 14th January 2011 (v0.4)

      • Export/Import Selection added: Export/import selection option added so parts of the model can be edited

      • Better Image Checking: The regex checking for BMP and JPEG images has been updated

      • Opacity & Color retained: Material opacity and color settings are now retained when they are modified

      • 9th January 2011

      • New Materials on Import added: On import, new materials are created for textures that have no existing matching materials in the model

      • Image checking: added some rudimentary regex image checking to the import script, could still be a bit buggy

      • Debug and reports: known errors are reported in the ruby console when open on operation

      Known Issues

      • Targa files will import but can't be written with the TextureWriter[/list]

      -niall

      PS:If you run into any trouble importing jpg,png,bmp or tif files please post the image to this topic so I can get a look at its header data.


      Version 0.41 - Updated 2011-01-14

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Very fast texture writer

      I've updated the plugin to preserve opacity and color settings for each material. There's also improved regex in the image type checking function, which will better check for imported image filetypes. I've also included the option to export and import by selection, which will give you the option of mass editing textures from certain parts of your model. Follow the link: Very Fast Texture Writer v0.4

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Face(s) to group(s)

      @edson said:

      what is a hard edge in sketchup?

      I presumed it was the opposite of a hidden, soft or smooth edge

      @bentleykfrog said:

      All Edges Hard: Turns all edges in the selection to unhidden, unsoft and unsmooth (ie a hard edge)

      If there's better terminology for this I'll update the code.

      posted in Plugins
      B
      bentleykfrog
    • RE: [Plugin] Face(s) to group(s)

      @jim said:

      @daarboven said:

      I noticed this doesn't work with SU 6 because of this line:

      model.start_operation("Face(s) to Group(s)",true)
      

      if you edit it to

      model.start_operation("Face(s) to Group(s)")
      

      leaving out the second parameter it works in SU 6.

      Thanks for the plug, anyway.

      regards

      Right. I have been using this:

      
      > if Sketchup.version.to_f < 7.0
      >   Sketchup.active_model.start_operation("Operation")
      > else
      >   Sketchup.active_model.start_operation("Operation", true)
      > end
      > 
      

      It ain't pretty, but it is clear and even explains a little about the reason.

      Thanks for the tips Jim and Daarboven, I've updated the script to check for this.

      posted in Plugins
      B
      bentleykfrog
    • 1
    • 2
    • 3
    • 4
    • 5
    • 4 / 5