Sketchucation Tools 5.0.7 | Licensing improvements and bug fixes Learn More

Subcategories

  • No decscription available

    20 Topics
    462 Posts
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • Find plane at intersection of 2 vectors

    13
    0 Votes
    13 Posts
    908 Views
    G
    I know exactly what you mean - I've built a lot of curved staircases. The challenge when it comes to modelling is to try an approximate the handrail profile and to manage ( or control ) the distortion. You feather the distortion over a distance so as to minimize it visually.
  • Overlapping detection

    2
    0 Votes
    2 Posts
    328 Views
    jolranJ
    There is BoundingBox.intersect But I gather you want to be more precise than so. So it will cost to calculate intersections for many Groups however you do it. You don't mention if is this is on 1 plane or 3d.
  • [C++SDK] ISkpRenderer

    10
    0 Votes
    10 Posts
    893 Views
    T
    @avariant said: Thanks! Look forward to that day (I hate COM). +1
  • Getting an active page

    9
    0 Votes
    9 Posts
    628 Views
    Dan RathbunD
    I know what he meant.. my arg still stands. Sometimes "active" is appropriate.. other times "selected" is more appropriate. Still other times "current" may seem more appropriate. There is a difference between the terms. They are not direct synonyms.
  • LoopLab Help

    3
    0 Votes
    3 Posts
    393 Views
    tt_suT
    You can collect all the separate loop-segments from the selection and then treat them separately. If you made the assumption that the user only selected one edge in each of the loops he/she wants selected then it's easier - as you just need to iterate each edge in selection and build a loop for each one. But it could be that the user selected multiple segments of a loop, in which you would have to detect this as well. Or, thinking of it, you could just ignore the fact that some are connected, just build the loop anyway and make sure you don't process an edge that's already in a generated loop.
  • Reading SKP thumbnail

    7
    0 Votes
    7 Posts
    557 Views
    tt_suT
    blink -- me neither! I guess I always just skipped over that method...
  • Basic question - groups as array ?

    5
    0 Votes
    5 Posts
    406 Views
    artmusicstudioA
    hi, thank you all, i tried to put my groups in the suggested ways into a loop, but i always get errors. with '@@groups' i would reach all grups, wouldn't i ? i will try to describe the whole problem: i have a defined amount of groups with one basic construction point (thanx dan), the amount changes by user input, so it must be variable, so there may be 2 or 20 @group_handlauf_mitte - groups. @group_handlauf_mitte1 @group_handlauf_mitte2 @group_handlauf_mitte3 @group_handlauf_mitte4 and so on i cannot find out, how can i access those 'group_handlauf_mitte ' groups in a loop to be able to select a group by @group_handlauf_mitte[index].entities. (my index here ist PODESTNR) i also tried to create the group name as a string-combination within a loop for step 1..20 a = "group" + step.tp_s.name a.name = a end but that's obviously not working , too. at the moment i have to define like this: if @podestnr == 1 entities = @group_handlauf_mitte1.entities new_line = entities.add_line rl13, rl14 entities = @group_handlauf_mitte1.entities elsif @podestnr == 2 entities = @group_handlauf_mitte2.entities new_line = entities.add_line rl13, rl14 entities = @group_handlauf_mitte2.entities elsif @podestnr == 3 entities = @group_handlauf_mitte3.entities new_line = entities.add_line rl13, rl14 entities = @group_handlauf_mitte3.entities elsif @podestnr == 4 entities = @group_handlauf_mitte4.entities new_line = entities.add_line rl13, rl14 entities = @group_handlauf_mitte4.entities end instead of this i would like to make a loop in which STEP decides, which grop's entities will become ENTITIES, but only for those groups, not all groups i have. hopefully i can once understand the syntax for group selection by index, because i could then make the ruby-code many times shorter. in this loop i need the griup name 1,2,3,4 to become dependent from the index MTH model = Sketchup.active_model y1 = 0 - @run ## the overall variables come from earlier code !!! y2 = 0 y3 = @run z = @rise pf = [] for mth in 1..10 entities = @group_handlauf_mitte1.entities ### MTH instead of 1 needed entities.erase_entities entities[0] rl1 = [0, y1, 0] rl2 = [0, y2, z] group = @group_handlauf_mitte1 = entities.add_group ### MTH instead of 1 needed entities2 = @group_handlauf_mitte1.entities ### MTH instead of 1 needed new_line = entities2.add_line rl1, rl2 length = new_line.length pf[mth] = [0, 0 - @run+@run*@il*(mth-1)+@run*@la*(mth-1)+@ro.abs, (mth-1)*@il*@rise+@sr] #mitte #point1 = Geom;;Point3d.new pf51 #constpoint = entities.add_cpoint point1 centerpoint = pf[mth] new_line = entities2.add_line rl1, rl2 vector = new_line.line[1] vector2 = vector.normalize! edges = entities2.add_circle centerpoint, vector2, @thradius kreis = entities2.add_face edges entity1 = entities[0] kurvem = entity1.all_connected status1 = kreis.followme kurvem end thanx for helping stan
  • Convert from .kml to .dae

    2
    0 Votes
    2 Posts
    2k Views
    Dan RathbunD
    The kmz is a zipped archive file. It has the dae file within it, inside the "models" folder.
  • RBZ update issue

    22
    0 Votes
    22 Posts
    2k Views
    jiminy-billy-bobJ
    Hmmm, right. Thanks
  • Material Take-Off by layers

    3
    0 Votes
    3 Posts
    441 Views
    pingpinkP
    Wow ! I changed the codes and it can analyze the layers. Thank you very very much , Dan !! selection.each { |s| is_group = s.is_a? Sketchup;;Group is_component = s.is_a? Sketchup;;ComponentInstance if s.layer.name == "Aluminium" ----continue---- }
  • Problem with component-definition in a loop

    2
    0 Votes
    2 Posts
    272 Views
    Dan RathbunD
    See the BBcode help page You need to use the [ code ] ... [/code ] bbCodes around your code example and it will look like this: [code:11ffgczd] Some example code; a = [1,2,3] last = a.pop puts last[/code:11ffgczd]
  • [Webdialog] freeze during Ruby operation

    9
    0 Votes
    9 Posts
    1k Views
    jolranJ
    Draw method, in a tool. Sorry, my misstake. Calculations for nodes are done outside the tool class. Passing through those methods I collect information to be sent to a container that the Tools draw method fetches information for rendering. I have a bit of work left there to get things organized. The data changes constantly so it will probably cost more to iterate what is needed to be updated then to redraw everything in 1 go. Since mostly dealing with Points and vectors, the new data will probably be totally different then the old anyway. I just clear the old data and bring in new, sort of, without going into details.. There are different types of data though. Persistent data that references to a Sketchup entity for ex, can be cached and updated only when switched. Anyway got a new situation now(TOPIC), have to redesign a lot on the Ruby side. I've studied your render cache. It's very nice and good example. Need to study it more though. Thanks for the input
  • Coordinates entered with InputBox

    5
    0 Votes
    5 Posts
    935 Views
    TIGT
    The last line newFace = selection[1].offset(-.25) is wrong! Try selection=model.selection newFace = selection[1].offset(-0.25) OR newFace = model.selection[1].offset(-0.25) The error is actually quite clear - it is telling you that 'selection' hasn't been defined ... Note it's best to use 0.25 NOT .25 Also how do you know what selection[1] is going to be ??? The API's offset() method is to offset a point3d by a vector3d + an optional length BUT there is an offset() method that can be added for faces, edges etc - BUT this is added by another script [by Rick Wilson?], but I don't see you 'requiring' it at the start of your code... Another tip: your input... defaults = [10,20,15] fixes the inputs as integers, if you want the input in inched use decimal numbers: defaults = [10.0, 20.0, 15.0] OR defaults = [10.inch, 20.inch, 15.inch]
  • Learning Ruby by Writing a Working Shell?

    9
    0 Votes
    9 Posts
    666 Views
    M
    Thanks Dan, coincidentally I just bought the pick axe. I'll be hammering though my way through that starting this weekend Sent from my Galaxy Nexus using Tapatalk
  • Transforming an array of points

    27
    0 Votes
    27 Posts
    1k Views
    jolranJ
    Yet Another test Don't know how reliable this test is but it appears face get appended in the same order as indexed in Polygonmesh. But Polygonmesh Count indexes starting at 1. Edit: Updated for adding c_point in polygonmesh index as well. But wonder how hidden edges affect the Index ordering.. The API says: @unknownuser said: The negative values should not be used as an index for point_at, take the positive value of the index value in the polygon array Perhaps hidden edges will only happend if mesh is constructed from a collection of Sketchup::Face's. Not relevant in this case. In that case maybe use index.abs or perhaps double negation: index = index<0 ? -index : index ents = Sketchup.active_model.active_entities def centerpoints(f) cx = (f[0].x + f[1].x + f[2].x + f[3].x)/4 cy = (f[0].y + f[1].y + f[2].y + f[3].y)/4 cz = (f[0].z + f[1].z + f[2].z + f[3].z)/4 return Geom;;Point3d.new(cx, cy, cz) end face1 = [ Geom;;Point3d.new(-5,-5,0), Geom;;Point3d.new(5,-5,0), Geom;;Point3d.new(5,5,0), Geom;;Point3d.new(-5,5,0) ] #create points for 4 faces faceHash = {} for i in (0...4) faceHash[i] = face1 face1 = face1.collect{|pt| pt.offset([20,0,0])} end #get refference to the center of "face"#3 Before appending to mesh. fC = centerpoints(faceHash[2]) ents.add_cpoint(fC) # Bit strange to loop hash this way, but they get ordered. msh = Geom;;PolygonMesh.new for n in (0...faceHash.length) msh.add_polygon(faceHash[n]) end #Test PolygonMesh index. How does hidden edges affect indexes for this ? # +1 index for polygons in Mesh. 2 c_points should get added at same spot meshface3 = msh.polygon_points_at(2+1) mc = centerpoints(meshface3) ents.add_cpoint(mc) group = ents.add_group group.entities.add_faces_from_mesh(msh) faces = group.entities.grep(Sketchup;;Face) #Red material to face 3 faces[2].material = "red"
  • Trim along a sandbox outline

    8
    0 Votes
    8 Posts
    846 Views
    BoxB
    I'll leave it at that, You are an advanced user and are obviously talking over my head.
  • Glued_to problem

    6
    0 Votes
    6 Posts
    528 Views
    tt_suT
    @existme said: Thanks so much It's a pity that you cannot glue to other component's faces via API. Indeed.
  • Co planar test

    27
    0 Votes
    27 Posts
    2k Views
    tt_suT
    With an Point3D version of the Oct tree I don't think the point comparison will be an issue any more. From the tests with vertices it scaled very well. Though I have some more ideas for the PolygonMesh class.
  • Thumbnail images as textures

    3
    0 Votes
    3 Posts
    333 Views
    A
    Thanks TIG.
  • Excluding from undo stack

    8
    0 Votes
    8 Posts
    559 Views
    Chris FullmerC
    If this system is entirely under your control, it would be easy to include all the geometry in the template model. Then when the user opens a new model, all those components are there without any possibility of being undone.

Advertisement