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

    ppoublan

    @ppoublan

    10
    Reputation
    1
    Profile views
    116
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    ppoublan Unfollow Follow
    Extension Creator registered-users

    Latest posts made by ppoublan

    • RE: [Plugin][$] 3D Tree Maker - New version 1.10.14

      I uploaded in sketchucation plugin store a new version that is working with SU2016 and SU2017.

      posted in Plugins
      ppoublanP
      ppoublan
    • RE: Error Drawing Lines

      Better understand. Thanks slb for these explanation.

      I Cant use scaling in this case as the points are the result of crossing lines, so at any scale the resulting point of two lines crossing can be very close to any other point in the model.

      This gave me an idea for a very bad workaround. Do not like it, but it works. this way SU does not seem to try sharing same vertex...
      pt1 = Geom::Point3d.new(0.98787,0.926013,0)
      pt2 = Geom::Point3d.new(0.988135,0.925025,0)
      pt3 = Geom::Point3d.new(0.977696,0.924673,0)
      grp1 = Sketchup.active_model.entities.add_group
      grp1.entities.add_line(pt3,pt2)
      grp2 = Sketchup.active_model.entities.add_group
      grp2.entities.add_line(pt2,pt1)
      grp1.explode
      grp2.explode

      Thks again
      Pascal

      posted in Developers' Forum
      ppoublanP
      ppoublan
    • RE: Error Drawing Lines

      Thanks Dan,
      But then how could you explain the second example works fine ?

      posted in Developers' Forum
      ppoublanP
      ppoublan
    • RE: Error Drawing Lines

      Hi sdmitch,
      Sorry but do not think this is the reason cause :

      • pt1/pt2 distance is 0.0010229217956422459 inches, so equal or above 0.001 inches
      • if it was the reason, the second code would not produce different result
      • and last, in both codes, the 3 different points are correctly setup by SU, just the joining lines are incorrect
        ...
        Still looking for a solution. I could add to my code to test minimum distance longer than 0.001 inches, but in this case this would not solve the issue.
        Pascal
      posted in Developers' Forum
      ppoublanP
      ppoublan
    • Error Drawing Lines

      Dear all,
      I'm facing an issue I can't understand.
      These two codes should produce the same result.

      Here is the code that does not draw the correct lines :
      (no line is drawn from pt2 to pt1 and this line is replaced by one joining pt3, pt1)

      pt1 = Geom::Point3d.new(0.98787,0.926013,0)
      pt2 = Geom::Point3d.new(0.988135,0.925025,0)
      pt3 = Geom::Point3d.new(0.977696,0.924673,0)
      Sketchup.active_model.entities.add_line(pt3,pt2)
      Sketchup.active_model.entities.add_line(pt2,pt1)

      And what I got when running it in the console
      error.JPG

      If I reverse the order lines are drawing, I got the correct result.

      pt1 = Geom::Point3d.new(0.98787,0.926013,0)
      pt2 = Geom::Point3d.new(0.988135,0.925025,0)
      pt3 = Geom::Point3d.new(0.977696,0.924673,0)
      Sketchup.active_model.entities.add_line(pt1,pt2)
      Sketchup.active_model.entities.add_line(pt2,pt3)
      correct.jpg

      I was thinking of something linked to the precision of SU but cant explain if its the limit why the one code produces the correct result and the other not.

      Any idea appreciated.
      Yours
      Pascal

      posted in Developers' Forum
      ppoublanP
      ppoublan
    • RE: 3DArcStudios trees work, but not grass

      Hi Larv,
      Sorry for the late answer, did not see you question before.
      Probably you alredy found the answer.
      When you place grass, it is added to model in proxy mode (only skeleton lines).
      You need to redraw your tree/plants to get them in full mode and they will be rendered.
      You can switch back with one click to proxy mode once rendered, to keep your model not so big and not to slow while working on other parts of your model.
      Yours
      Pascal

      posted in Plugins
      ppoublanP
      ppoublan
    • RE: Distance between two points / optimization

      @unknownuser said:

      Since I did not see the aim of this algorithm. I think it's a relevant question to pose
      what are you going to do with these Points ?

      I'm working on a new way to create grass within Tree Maker (put a lot of plants on surfaces) that I would like to look more realistic with more or less dense zones. Now it works, but looking to improve and optimze it.

      Really thanks to all of you for your very good ideas and feedbacks.
      Now I have to implement this.

      Pascal

      posted in Developers' Forum
      ppoublanP
      ppoublan
    • RE: Distance between two points / optimization

      Thanks for your answer,
      I will make more tests with this method.

      Regarding this point

      @unknownuser said:

      Regarding you code I'm not sure what you want to do with marking the Points with a boolean.
      It might be faster to append results to a new Array rather then store a lot of small arrays . And maybe even use a Hash.

      The idea was NOT to compare all points, but as some are discarded, to be sure they are not compared in the loop with all others, to reduce the total number of comparisons.
      If I copy "valid" points in another array, I will have to compare all points, even those already found as "too close".

      Thanks again
      Pascal

      posted in Developers' Forum
      ppoublanP
      ppoublan
    • Distance between two points / optimization

      Dear all,

      I have an array of points.
      I would like to remove those that are at a distance from another point less than a minimum spacing.

      The following code seems to do it, but I would like to know if you think there is a faster/more efficient way to proceed (the distance comparison of all points, not the drawing part).

      Yours
      Pascal

      
      def test_distance
      
      	pts = []
      	
      	max = 5000
      	maxdist = 1000
      	mindist = 50
      	
      	for i in 0..max
      		pt = Geom;;Point3d.new(rand*maxdist,rand*maxdist,rand*maxdist)
      		pts << [pt, true]
      	end
      	
      	start_time = Time.now.to_f
      	
      	for i in 0..max
      		if pts[i][1] == true
      			for j in (i + 1)..max
      				if pts[j][1] == true
      					pt1 = pts[i][0]
      					pt2 = pts[j][0]
      					dist = pt1.distance pt2
      					if dist < mindist
      						pts[j][1] = false
      					end
      				end
      			end
      		end
      	end
      	
      	end_time = Time.now.to_f
      	
      	puts (end_time - start_time).to_s
      	
      	Sketchup.active_model.start_operation("test",true,false,false)
      	for i in 0..max
      		if pts[i][1] == true
      			Sketchup.active_model.entities.add_cpoint(pts[i][0])
      		end
      	end
      	Sketchup.active_model.commit_operation
      
      end
      
      
      posted in Developers' Forum
      ppoublanP
      ppoublan
    • RE: [Plugin][$] 3D Tree Maker - New version 1.10.14

      "never let a bug, Oxer will point it"
      Added to the todo list.

      posted in Plugins
      ppoublanP
      ppoublan