• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

Scheduled Pinned Locked Moved Plugins
360 Posts 41 Posters 228.5k Views 41 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.
  • J Offline
    jolran
    last edited by 19 Sept 2011, 18:50

    I've updated the dialog so it doesen't take up that much space(CSS hell 😑 )

    Deccided to hard code the list of components(hatches) in the HTML code.
    It's easy to change or add components. Thataway won't have to worry about sending many strings back and fourth?

    Component names and pics are the same exept for the extension(.gif) for pic.src.

    This step is to update the picture preview:

    The main idea is to get the name from selected component in the list.
    Use that names.text + "img/" and ".gif" to change the image source in javascript.

    Any JS expert that can help me with the following code?
    (been googling JS code for 2 days now..)

    The main thing is that I DON'T want to preload the pictures, like everyone else seams to like. There could be hundreds of them and it's not a slideshow πŸ˜„ ..

    html
    
    <select id="selskp" name="components" size=15 onChange="setImage(this)" >
    									
    									
    <optgroup label="Line Hatches">
    	<option>Line solid fast</option>
    	<option>Line dotted</option>
    	<option>Line dashed</option>
                  etc........
    
    JS;
    
    var imgSource = document.getElementById("imag").src="";
    
    function setImage(imageSelect) {
     theImageIndex = imageSelect.options[imageSelect.selectedIndex];
     if (var imgSource)
         var imgSource = eval("img/" + theImageIndex.text + ".gif");
      }
    

    web2.jpg

    1 Reply Last reply Reply Quote 0
    • J Offline
      jolran
      last edited by 20 Sept 2011, 14:03

      Yeyy! Got the picture switching going. First success in Javascript.

      Well this is the code I use if someone is in the need for it. If it can be improved, please tell.

      The function change picture source by the name of selection in scrollist.
      You will have to call the function in the <select> tag in the HTML, by "onchange" + "functionname".

      function changePic(hatchImage)
      {
          // Get the select options text
          var i=document.getElementById("selskp")
      	var hatchSelect = i.options[i.selectedIndex].text; 
          
         // Create our Image src name, concat
          var hatchImage = "img/" + hatchSelect + ".gif";
      
          // Assign the image
         document.getElementById("imag").src = hatchImage;
      }
      
      
      And in the html you just call onchange="changePic()" 
      
      <select id="selskp" name="components" size=15 onChange="changePic()" >
      
      
      
      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by 20 Sept 2011, 17:07

        Y'see! it's easy πŸ˜‰
        [If you spend hours learning it! ]

        TIG

        1 Reply Last reply Reply Quote 0
        • J Offline
          jolran
          last edited by 20 Sept 2011, 17:59

          I woulden't say easy. I'm thick as a mid-evil castle door.

          Yep, hours it is. Rewarding sensation when things get going a little. Time before that is frustrating pain πŸ˜„ .

          1 Reply Last reply Reply Quote 0
          • J Offline
            jolran
            last edited by 26 Sept 2011, 19:42

            Bonjour.

            I thought giving a little update, so you don't think I have given up on the plugin. πŸ˜„

            Due to webdialog testing I'll noticed that the script had to be reorginized quite alot. Especially if LineHatching and ordinary component patterns are supposed to coexist in the same script. And there will be options for crosshatching for comp.patterns as well!

            • color background(or none).
              So in order to keep the same requested grouping as LineHatches, there where a lot of conditions to be met to even be able to test the dialog. And the webdialog part is hard to code..
              At the moment I can "stear" the plugin with @variables set to TRUE or FALSE or VALUE.
              The idea is to link those to the Webdialog later on.

            The way I have organized the script is methods on top. And a main script just calling methods with if statements. The methods have few arguments. Mostly (group) or (face), so things are easy to keep track of and to reuse methods.

            Then the question is. Is there any performance differences in having it set up this way. Compared to having Modules loaded in(with methods) like I see a lot of coders use. It's not a very long script. 400 - 500 lines of code.

            Here's a pic of crosshatching with comp-pattern. Grouping the same as LineHatching. Can't get rid of the border on comp-patterns though. Tough nut to crack...
            Much easier with LineHatches.


            version1.8 preview.jpg

            1 Reply Last reply Reply Quote 0
            • ipsketchpiI Offline
              ipsketchpi
              last edited by 17 Oct 2011, 19:23

              Great plug in, I did it little different till now. These plug in is cool stuff in SU. Thank you.

              /IP

              1 Reply Last reply Reply Quote 0
              • J Offline
                jolran
                last edited by 18 Oct 2011, 09:39

                Thanks for feedback πŸ‘ .

                FYI. I'm working on the next version quite hard and on an every day basis. Even if there hasent been any updates lately in this topic.

                1 Reply Last reply Reply Quote 0
                • C Offline
                  ciudadanochano
                  last edited by 19 Oct 2011, 13:28

                  Hello:

                  IΒ΄m new in this forum. Could be possible to be rendered with v-ray?. If it were a normal material?

                  Thanks.

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    jolran
                    last edited by 19 Oct 2011, 17:30

                    Hi Ciudadanochano!

                    I can imagine having a woodframe-construction with wood textures and in some angles show of some hatchpatterns. Is it something like that you desire?

                    But I think one will need a face with a material in any case, for a render. Unless "wireframe" is an option in your render-engine?
                    I have Vray as well. And could probably look in to that a little later on..

                    You can fake it though if you can match Sketchups field of view and pixelratio!

                    Just render 1 black and white version in Sketchup(with hatches) and and 1 version i Vray.
                    Then blend the pics with some type of layerblending in Photoshop.
                    Cheap trick though πŸ˜• ....

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      kaas
                      last edited by 14 Nov 2011, 20:10

                      Hello Jolran,

                      Any new developments you're willing to share?

                      Greetings, Max

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        jolran
                        last edited by 15 Nov 2011, 08:24

                        Yes, sure if you like.

                        Think I'm ready with the base of the dialog. I'm porting it to Sketchup as of speak.

                        There where a lot of Javascriptcode to get the interface responding to certain events. For ex if one checkbox is selected another element is disabled, and such.
                        Using Jquery to help with DOM handling and events. And a spinnbox plugin.

                        I'm also sending lists from Sketchup to Dialog. Materials, components and layers.
                        Instead of hardcoding them in the HTML.
                        For patterns the user will be able to create new components as long as they put them in correct folder. And maybe create a pic as well(optional).

                        It's moving forward everyday actually. Slowly but steady. Will still have a lot of cleaning, testing and streamlining to do. But hopfully it will be a useful plugin.

                        Here is a screencap from latest dialog version. The style is to keep the interface as "Sketchup" as possible. Opinions in this style would be nice.
                        I could go crazy with colors but I kinda like this Sketchup style.


                        webver_4.jpg

                        1 Reply Last reply Reply Quote 0
                        • K Offline
                          kaas
                          last edited by 16 Nov 2011, 17:36

                          Hello Jolran,

                          Good to see you're still developing the plugin.

                          The screenshot looks good! Very nice you use the Sketchup style for the dialog, it's more easy on the eyes. I Hope you can treat us with a new test version at some point in the near future. Good luck in the meantime!

                          Greetings, Max

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            jolran
                            last edited by 16 Nov 2011, 18:42

                            Thank you Max.

                            Glad you liked the style. It's quite easily changed if users would want so.

                            @unknownuser said:

                            I Hope you can treat us with a new test version at some point in the near future

                            I'm working on it. Quite hard acctually, it's my baby. Can't give any dates, cause I'm not experienced enough in scripting to tell how long certain things will take πŸ˜„

                            There is one thing that might pose some problems for the whole idea of the plugin.
                            After intersections there are quite often errors. I don't think it has so much to do with the script itself creating errors, but as to Sketchups accuracy. Wich is 0,001 inches.

                            It's really bugging me. Sometimes edges don't intersect with faces or small faces gets lost.

                            My theory is that I'm importing components and tiling them and doing plenty of transformations, wich can lead to: Vertices and edges are lying outside a position tolerance of what Sketchup can handle(intersect).

                            Compare that to using native Sketchup tools creating geometry. For ex drawing edges with the pen tool on a face, that would almost always give you tolerated vertice positions(unless you group and move them) for intersecting.

                            Well that's only a theory. But I must solve the problem somehow.

                            Hope that did not come out to negative Max. But as you can see there are still some work to do.

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              dtrarch
                              last edited by 17 Nov 2011, 17:39

                              Hi Jolran

                              Just a lurker but what fun to see you and TIG hang in with such tenacity. β˜€
                              Thanks for this really useful and interesting tool. πŸ‘ πŸ‘

                              Cheers πŸ˜„

                              dtr

                              1 Reply Last reply Reply Quote 0
                              • M Offline
                                markitekt
                                last edited by 6 Jan 2012, 19:22

                                Any news on what looks to be a very promising plugin?
                                Mark P.

                                1 Reply Last reply Reply Quote 0
                                • brookefoxB Offline
                                  brookefox
                                  last edited by 11 Mar 2012, 20:17

                                  After having used the plugin, I came back by because I thought I had some ideas for you but seeing the various screen shots it looks as if you are well beyond what I get with the plugin, so either mine is not up to speed or I am not implementing correctly or you have not posted one which gives what is shown... My version just has hatches > line hatches resulting in only the possibility of cross hatching.

                                  I forgot to say how thrilled I am to find your routine and hopeful for what I may be able to do with it... It fills a long standing hole in SU's arsenal.

                                  http://img694.imageshack.us/img694/2706/hatchexampleneeded2.jpg

                                  ~ Brooke

                                  1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    jolran
                                    last edited by 12 Mar 2012, 14:03

                                    Hello everyone! πŸ˜„

                                    I AM working on the plugin. Just have been very busy lately with house renovation(I do this SU-programming on spare time).

                                    Brookefox. The downloadable version you have, only does linehatches at the moment.
                                    Although I've earlier posted pictures of current development features (here and in LO-forums)in order to get feedback and suggestions.

                                    Must admit, for a while I got the impression most people where content with using textures for hatching(At least at the LO forums). So I got a little side-tracked πŸ˜•
                                    Started to work on other features, like 3d hatching and such..

                                    Thanks for the feedback guys Really apreciate it.

                                    Will be back on track soon.

                                    / Joel.

                                    1 Reply Last reply Reply Quote 0
                                    • brookefoxB Offline
                                      brookefox
                                      last edited by 12 Mar 2012, 16:41

                                      Thanks for checking in, Joel. My guess is some of us would be happy to use a more fully implemented beta, as it seems so useful, with the obvious risks inherent. Personally, I'm looking for all edges and faces (no textures, no images), and components (preferably gridded). In my small experience it seems like the gridded components offer the greatest promise as they may be infinitely and easily editable.

                                      If I could just cast components on a specified grid within bounding edges (faced or not), I think I could be happy. (What happens to components that intersect bounding edges? Ideally, they would be trimmed, or optionally trimmed.)

                                      http://img816.imageshack.us/img816/2043/combohatch4.jpg

                                      ~ Brooke

                                      1 Reply Last reply Reply Quote 0
                                      • J Offline
                                        jolran
                                        last edited by 12 Mar 2012, 19:33

                                        Thanks for the input and ideas Brookefox πŸ˜„

                                        Gridded components you say? Do you mean patterns or using some sort of workplane?

                                        You will be able to load premade patterns(components) from folders. Where you also can make your own patterns and stuff them in there.

                                        Anyway, The way the plugin is working now, is that a face-edges determine the boundarys. That way the user don't have to worry about which plane one is working on.
                                        Everything outside the face will be trimmed, including holes. Just like it's working in the current downloadable version.

                                        The plugin as is now, is not beta ready 😞 . I actually might do a "light" version for user testing at first. Cause there are so many things added it might be difficult for me to keep track of things when complaints starts to hail in πŸ˜‰

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          jolran
                                          last edited by 12 Mar 2012, 23:40

                                          @unknownuser said:

                                          Just 'patterns,' which are in fact component instances which can then all be changed by editing one of them

                                          Brookefox, I'm afraid that will not be possible if you mean altering them after the hatch-components are fitted to the face.
                                          What will happend(in the code) is that all tiled instances will be exploded before doing an intersection with the face. And in the end become 1 large component.

                                          I think Smidths plugins was an request to solve a particular problem, spacing out plants and stuff, including triangular array. In those cases one may not wish to delete geometry outside the faces. Works very well for what it was designed for, I think.

                                          Hatchfaces plugin obviously will be more "pattern-fit a face" sort of thing.

                                          Thanks for answering.

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 13
                                          • 14
                                          • 15
                                          • 16
                                          • 17
                                          • 18
                                          • 15 / 18
                                          • First post
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement