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

    Posts

    Recent Best Controversial
    • RE: Clone PolygonMesh

      @unknownuser said:

      The data has to be stored somewhere. At least for Vray, the properties are stored as an XML structure in the material's attributes.

      Allright!
      Can't say I havent thought about the idea to include this functionality into the plugin,
      to be honest.
      But the risk of feature freenzy and bloat is to big, so I probably stick to only a design/modeling tool.

      @unknownuser said:

      Well I think I would be. I mean, this king of UI without zooming is kind of cumbersome, don't you think?

      Yeah, I guess you are right. Come to think of it, you might be even more dependent of "special-nodes", displaying textures and stuff.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      πŸ˜„ Thanks for the understanding! It's a touchy subject.

      A material editor! Is it possible to hook up to thoose from within Sketchup ? I thought they kept their code closed. The Render-engines that is.

      Then, I shouldent rule out Jsplumb completely, if I was you.
      It wasent an easy decision to restart from scratch and change library.
      For the record I had no stability problems with Jsplumb. It was more a matter of performance in combination with JQ UI, and a few features I did not manage to implement.

      A few things have changed since then for Jsplumb. It's not dependent of Jquery UI draggable for one. = faster.
      It has Jquery style syntax, so you would feel at home directly, don't need to learn about SVG, if you don't know it already that is. Also more compatible with browsers than d3.
      Has inbuilt events for connections, so it's MUCH easier to set up. But it's quite a large library. 10K +

      So if you are not 100% dependent on zooming/multidragging go for jsplumb. At least give it a go. You will get going in a couple of days, Ive seen your layerspanel. No prob.

      That said. You would have a lot of fun learning d3, when you passed the init threshold.
      My goal was to learn as little as possible, cause it's easy to get stuck with experiments πŸ˜„ Amazing stuff they do..

      Scattering plugin, you say. Sounds very interesting indeed. Can be as complex as you like it, I presume.

      @unknownuser said:

      So let me know if you have any question regarding this topic.

      I sure will! And the same goes for you. Can PM snippets and shiat.. πŸ˜„

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      No sorry.

      I havent decided the future for this plugin yet. 😐

      Was thinking a free version and then if things progress well maybe a more advanced Pro version. That will keep everyone happy.

      That also means restrictions on the license, so Github will not fit.

      I hope you understand. 😳

      This may change. Plugin's status isent release ready anyway.
      I did not post the gif to show off. Just was so god damn happy it worked I needed to share my joy.

      BTW I appreciate you offering help. PM me for questions regarding code. No Problem.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      Hi. Jiminy πŸ˜„ wasent expecting any response..

      It's a standard webdialog. Pure JS and HTML.
      The canvas and nodes are all SVG. Then the rest are plain html elements. like Tooltips, contextmenus etc.

      I switched to D3.js. Not a compability layer, but have some nice selectors and methods.
      It has such nice zooming and panning. Also very fast!
      You should check it out! People think one can only use it with SVG, but that is not true.

      It needed quite a bit of Javascript code to get the interaction working, since d3 is quite lowlevel. There are no solution for handling multiproperty nodes. There's layouts, but I'm basically only using the selectors and the zoom/pan functions.
      Everything is programmed from scratch. Connections, nodes etc.. So I am expecting hickups here and there..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      Yey! It works! At least at Cube level πŸ˜›


      createcubemin1.gif

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      I'm toast.

      One cannot refresh the Polygonsmesh. Polygons keeps getting added even if updating points with setpoint(which make sense though). I presume there is no way to delete polygons ?
      I noticed cpu worked hard. So I counted polygons. + + + ++++ 😞

      I guess only way is to use PolygonMesh.new() at every update ?
      Not so funny since a sliderhandle may update values 100+ times in milliseconds..
      I'm not sure about best practices here, sounds expensive to create new objects frequently.

      Update: Polygonmesh.new() works.
      Don't know if there is any sideeffects appart form heavy GC lifting..
      Considering one often creates and dispose Point3d objects quite frequently I can't see why it couldent be done with a PolygonMesh πŸ˜•

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: [Plugin] Deck Builder (Updated 23-Jun-2015)

      Well done!

      posted in Plugins
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      That code looks compact enough. πŸ‘
      Does it matter for performance not providing arguments in PolygonMesh.new(), or is the docks wrong(again) ?

      @unknownuser said:

      P.S.: Ruby 2.0 has been optimized much more than the old Ruby 1.8 trunk.

      I know 😳 Still klingin on to SU8.. Poor old sod.

      And regarding that, I was looking for a way to iterate by 3 (for converting a quadpoints-array
      to tri-points-array that I can push to GL_TRIANGLES.)

      so each_slice(3) looked suitable. Turned out was only compatible with ranges for ruby 1.8.

      Edit: removed code that wasent working...

      @unknownuser said:

      Have you seen:http://www.thomthom.net/software/vertex_tools/

      Yeah! Amazing tool. He's draw class is an inspiration. I do have peeked inside there πŸ˜„

      updates:
      I forgot Polygonmesh removes duplicates. (It seams so anyway.)
      So it may be hard to recreate polygons later in another context without adding in the polygons..
      It's also peculiar to update the mesh points.
      Assuming the only way to edit/replace points is use of set_point(index, point) ?
      PolygonMesh.points.clear! would be good to have..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      Thanks a lot for the code Dan, I will definately test it!

      Doing mostly JS for the past 6 months, is the good old for loop abandoned in Ruby ? πŸ˜„

      The code:

      @unknownuser said:

      You need to "absolutify" each index, in case any edges are hidden

      Yeah, I noticed that. But it was a hard lesson learned.

      I'm revisiting old code and I see some comments regarding abs performance issues. ❓
      So for some reason I used this. However you abs method looks slicker.

      def self.positivVal(a)
          a = a < 0 ? -a ; a
      end
      

      To further clarify, this concerns my parametric node modeler( long going project unfortunately )
      It displays temporary geometry via the view draw class.

      So I have to build compatible arrays or hashes not only for the PolygonMesh but also for the view draw methods in the update methods.
      I've decided to build a solution for each node. So next node in "chain" that takes this polygonMesh as an input will have to be clone it.

      I'm using this code for that

      #Clone 1 mesh
      def self.clone_polyMesh(mesh) 
      	#Counts
      	npolys = mesh.count_polygons
      	#mesh
      	meshclone = Geom;;PolygonMesh.new( mesh.count_points, npolys )
      	for i in (1..npolys)
      		plps = mesh.polygon_points_at( i )
      		meshclone.add_polygon( plps )
      	end
      	meshclone
      end
      

      But your code looks more compact, so I might try that instead.

      ❓ The question is if I have to build the polygons until the mesh is baked ?
      Like the first code you posted Dan. For just adding points might be sufficient.
      Keep the polygonMeshes with points only. And when it's time to bake build the polygons.
      I might be overlooking something that must be done in the right context/scope....

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      @unknownuser said:

      NO they would be VERY useful IF they worked.

      Thanks for clearing that up, and for the code suggestion.

      edit: I think I described my scenario poorly. I need to have the Polygonmesh cloned with polygons as well. So a container for only points wasent perhaps an accurate description..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Clone PolygonMesh

      Aha.. Thank you Dan.

      You are meaning that the console is showing methods that does not belong there, right ?
      Just want to make sure I understood you correctly..

      posted in Developers' Forum
      jolranJ
      jolran
    • Clone PolygonMesh

      Hi.

      I take it one cannot Clone/Copy a PolygonMesh ?

      Something like mesh2 = mesh1.clone. ❓

      PolygonsMesh do respond_to?(:clone) (or dup), so I thought there was a slight possibility there..

      However it gives an error: "reference to deleted PolygonMesh" when calling fill_from_mesh.

      Would be convenient to be able to copy P.meshes around as containers for points, since transforming Polygonmesh is so fast.

      I already have workarounds if this is not possible BTW.

      Thanks!

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: SketchUp Debugging for Notepad++

      ditto.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: [REQ] Deck Builder

      Wow, that's fast!

      @unknownuser said:

      All I have is trying to fulfill a few of the insane request of SketchUp users

      Your living the dream! πŸ˜„

      I don't have a big deck yet, so I'm working HARD at gettin it/there πŸ˜›

      posted in Plugins
      jolranJ
      jolran
    • RE: [REQ] Deck Builder

      😲 What the F.......

      Did he do that in just a couple of days or has he been working on it for a while ? ..

      I need to get some Amfs..

      posted in Plugins
      jolranJ
      jolran
    • RE: How do you intersect two faces?

      This is what I do (sort of) in 2dboolean. But with 11000 faces πŸ˜• ...

      @unknownuser said:

      Because it is all Ruby, I don't know whether this will actually be any faster than letting the built-in function handle the whole thing though.

      20 seconds is better than 25 πŸ˜„ every optimization counts or are worth trying

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: How do you intersect two faces?

      Join the party...

      intersect_with is slow, but probably necessary evil.

      That's quite a large collection you are having.

      I found it ever so slightly faster in 2Dboolean to intersect with 1 of the groups containing edges only, to cut out the desired frame of desired geometry. But in your case that might not aid.
      I reported a strange behavior from that that never got answered, or maybe it's so well known it did not deserve an answer..

      "Edge collection still remembers face" - error, sort of thing..(scroll to my post)
      http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=55238%26amp;hilit=+intersect

      There was some post long time ago about using linesweeps instead, in the Cartesian plane.
      And perhaps break edges on "hit". I don't think it's trivial to build something like that..
      Maybe if it could be ported to C doing the calculations, however the cost..

      TIG's many plugins use intersections quite often. You should dig in there..

      If you would come up with something revolutionary you'd be a hero..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: [Plugin] FloorGenerator ( Updated 6-Apr-2017)

      Ha ha ! Ah ok! πŸ‘

      I thought I was getting high or something. One minute I thought I read about it in the developper section, then it was gone. So I removed my last sentence as well, just in case I was wrong πŸ˜† πŸ˜†

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] FloorGenerator ( Updated 6-Apr-2017)

      Sam I'm looking at your code here. Cant remember which version this is. So you may have changed this behavior.
      But in a callback you have a dialog close ?

      You have a select with an event onchange:

      <select onChange='patternchanged(value)'>
      

      The function then sends the callback

      function patternchanged(value){
         window.location='skp;PatternChanged@'+value;
      }
      

      In the callback block you have a dlg.close. So everytime select change dialog closes..

      @@dlg.add_action_callback("PatternChanged") {|d,p|
      	@@opt=p; puts p
      	if @@opt=="Reset" then 
      						["Brick","Tile","Wood","Tweed","Hbone","BsktWv","HpScth","Hexgon","Octgon","Two2One" ,"IrPoly"].each{|o| 
        Sketchup.write_default("FloorGenerator",o,nil)};@@opt="Tile";
        end
        @@dlg.close; @@dlg=nil; self.dialog
      }
      

      I also see you have the command self.dialog trying to reopend the dialog ?
      But it is set to nil before. Don't know if that messes things up..
      Maybe a timing issue ?

      posted in Plugins
      jolranJ
      jolran
    • RE: [REQ] Deck Builder

      Ahh. You got plenty of gadgets, I see..

      It's quite a lot of work involved creating such a specific tool, I imagine.
      Especially if keeping many options open.
      Chucks plugins looks fairly close though. He might be the man for the job since he is well on the way.

      posted in Plugins
      jolranJ
      jolran
    • 1
    • 2
    • 7
    • 8
    • 9
    • 10
    • 11
    • 51
    • 52
    • 9 / 52