You provided the points in anti-clockwise order as seen from above, which means the normal vector to the face would point upward (+z). Entities#add_face automatically forces the normal of a face drawn at z=0 to point downward, which causes your vertices to be traced in the opposite (clockwise) order. You can reverse the face after drawing it to correct for this, but there is no option by which you can turn off this "feature".
Posts
-
RE: Loops
-
RE: Wind generator
A couple of things occur to me. Most importantly, as the two rings move to feather the blades won't the distance between the posts mounting the blades change? There doesn't seem to be any mechanism to allow this movement. Maybe pivot on one of the rods and have the other move in a slot?
On a more engineering note, what you have designed is a mechanical negative-feedback governor. As such, it will have a resonant frequency at which the blades alternately increase and then decrease their feathering. With a bit of luck, the mechanism will have enough friction to damp out this oscillation, but it is something to be wary of as an inadequately damped resonance will build up until it destroys the mechanism!
Steve
-
RE: Ruby 2.0.0 Threads in SU | how to keep a subthread running?
According to Programming Ruby 1.9 and 2.0 section 12.2, Ruby 1.9 and 2.0 encountered trouble with numerous existing libraries that were not thread-safe. "So, Ruby compromises: it uses native operating system threads but operates only a single thread at a time." That is very likely what you are seeing.
-
RE: Mac and Materials (with textures)
What version of Mac, what os version, what version of SU (please fill out your profile so we can tell without having to ask!). I just tried your code on my MBP Retina, OS X 10.9.4, SU 2014 Pro, and it added all 1000 textures just fine (though slowly).
Steve
-
RE: Push/Pull Tool
@calgirl said:
@slbaumgartner said:
Check the View->Face Style and View->Edge Style settings to see what you have checked. Face Styles X-ray and Wireframe will cause things to show through. Edge Style Back Edges will also. Also, I assume you made the top a component and pushpulled it up, not down. Unless you make things components, the geometry will interact with other free geometry, and if you pulled down instead of up, the ends of the legs are actually coplanar with the top!
Thanks for your reply.
On the Edges Style I only have “Edges” checked
On the Face Style I have “Shaded with Textures:When I draw the rectangle using the rectangle tool, before I use the Push/Pull tool, the rectangle shows the legs and aprons of the table thru the drawn rectangle. When I then use the P/P tool to uplift the table top to 2 cm, I still have the leg tops and aprons showing through. There is no point at which I can make the top a component where the leg tops and aprons are not showing. The only way to get rid of them is to use the erase tool.
As Dave R also pointed out, the above reveals the cause of your problem: you need to learn about Groups and Components. You must gather all of the geometry for a single part into a Group or Component before you draw loose geometry for some other part. If you draw everything before grouping, the Edges and Faces all interact immediately. Your "top" rectangle was subdivided into several Faces as soon as you drew it, and at that point it can't be push/pulled as a single thing anymore.
-
RE: Retrievin object's absolute height ??
@sdmitch said:
@artmusicstudio said:
hi tig,
i understood and made some tests.
but if i have a group namedmod = Sketchup.active_model # Open model > > ent = mod.entities # All entities in model > > sel = mod.selection # Current selection > > @main_element = ent.grep(Sketchup;;Group).select{|g| g.name=="@main_element"}[0] > > tra = @main_element.transformation; #save the current transformation > > @main_element.transform! tra.inverse; # return the group to its created position > > zmax = @main_element.bounds.max.z; puts zmax; # get the max z > > @main_element.transform! tra; # return the group to its current position
thank you!
stanThe code block above seems to have been edited out of your earlier post, but sdmitch grabbed it first. It seems to reveal confusion between the name attribute of a group and the symbolic name of a variable that refers to that group. These are separate, unrelated concepts. That is, if you write
@foo = ents.add_group #@foo is a variable that refers to a group with no name attribute
@foo.name = "@main_element" #@foo now refers to a group with name attribute "@main_element"Following this code, there is no such variable as @main_element. Conversely, there is no group whose name attribute is @foo.
Your search above looks for a group whose name attribute is "@main_element". Did you assign that previously using Group#name=, or are you assuming that because you earlier created a group referenced by a variable named @main_element that the group has that as its name attribute (wrong). In any case, you need to test what value was assigned to @main_element by your search. I bet it is nil (because the search found nothing), and that is the cause of your syntax error.
Steve
-
RE: Push/Pull Tool
Check the View->Face Style and View->Edge Style settings to see what you have checked. Face Styles X-ray and Wireframe will cause things to show through. Edge Style Back Edges will also. Also, I assume you made the top a component and pushpulled it up, not down. Unless you make things components, the geometry will interact with other free geometry, and if you pulled down instead of up, the ends of the legs are actually coplanar with the top!
-
RE: This does not appear to be a SketchUp model
I don't know what method you are using to transfer the files, but in some cases (e.g. FTP) you need to make sure that the file is designated to be binary. Otherwise the transfer may try to convert line ending characters between Windows, UNIX, and Mac conventions, and that will surely corrupt a binary file such as a skp.
-
RE: Is an entity in a surface
The return is an Array of all the Faces from any surface containing the Face passed as the argument. If the Face is not in a surface, the return will be an empty array.
-
RE: Is SU the right method for professional casting?
In the "real world" it is a matter of your understanding with whomever you are providing the designs to. I don't know that there is any generally accepted practice. I'm sure it depends on whether your client is adequately knowledgeable about SketchUp. It also depends on the form in which your user expects to receive the model. You may have to convert it to something else, such as stl, before you send it on. In that case is it your problem to decide how your objects were meant.
Unless you annotate the model or provide separate documentation of your intent, someone using the model will have to provide their own interpretation. As noted, for some cases you can protect yourself by modeling at finer granularity (smaller Edges) than you know the user will require. Of course, this causes the model to have a very high Entity count.
You are faced with a fundamental aspect of SketchUp's design: it might be termed WYSIAYG (what you see is all you've got). In some other applications, an object is defined in an abstract mathematical form (e.g. center location, normal vector, and radius for a 3D circle) and is converted to line segments when and as needed. For instance, when rendered to the display, a circle needs to be converted to a raster image with pixels appropriate to the resolution of the display. On a different display, a different raster representation will be generated.
In SketchUp, there is no such higher-order abstract model. The Edges and Faces representing a shape are all there is. OK - picky point - a sequence of Edges can be joined together to form a polyline or polygon, but there is still no abstract model of the polygon as such.
So, for a circle, a user needs to know how to find the center and measure from there to a vertex to discover the original as-drawn radius. If it really matters and they don't have the SketchUp expertise to do this, you will have to do it for them and annotate the model.
This whole thing is a fundamental aspect of SketchUp's internal design, and part of how it obtains its much-treasured interactive user interface. Changing to the abstract-model-rendered-when-needed paradigm would be an end-to-end redesign of all the basic mechanisms of SketchUp.
Steve
-
RE: SketchUp 2014 Load Error Message
@james hookway a7 said:
Hi there,
I just recently tried to install a "Point Cloud Triangulation" plugin for Sketchup.
I originally installed one that didn't work. it was simply called "points_cloud_triangulation.rb".
I removed the .rb file from my SketchUp and tried a different one, "TIG_points_cloud_triangulation.rb". This one worked great for me.
Now though, rather annoyingly, every time I open SketchUp I am greeted with this message...
%(#FF0000)[Error Loading File points_cloud_triangulation.rb
Error: #<LoadError: cannot load such file -- delaunay2.rb>
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:45:in `require'
C:/Users/JamesH/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/points_cloud_triangulation.rb:21:in `<top (required)>']I have tried reinstalling SketchUp and all but I just can't get rid of this error message. It's strange, as this is the Plugin I removed earlier, but it is still giving me error messages for me. i just can't figure out how to disable it altogether. Very surprised a clean install didn't solve this.
Any suggestions?
Cheers.
That last line in the message would seem to be your clue: SketchUp is still trying to load points_cloud_triangulation.rb from C:/Users/JamesH/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins. Take a look there and delete the file.
A fresh installation only overwrites the contents in the application's own folders, it does not erase or overwrite your per-user plugins.
-
RE: Intersection does not work
I'm not completely sure I understand what you are trying to do, but here's a stab:
How did you originally chop off the bottom of the complex shape? From some playing with your model, it appears to me that the bottom edge may not be perfectly planar. If you reveal hidden lines, zoom in, and roam around, you find strange looking things like these:
I think the intersect is generating Edges where bottom Edge segments of the shape lie in the plane, but leaving gaps where they do not, and as a result the intersections do not form closed shapes the way you expected.
HTH
StevePS: those sorts of tiny missing triangles are typical of what happens if you do many kinds of operations without first scaling up the model enough. SketchUp does not draw Edges when it thinks their Vertices are too close together, and that causes jagged edges and missing Faces.
-
RE: Compound angle Tool
Version 0.3 now available on the sketchUcation Plugin Store adds leg vs box type to allow planes to be located more usefully for compound miter joints vs legs.
-
RE: Inputbox chedking for cancel
John and Jim beat me to the punch! Your code example does not do any of the tests you mention.
UI.inputbox does return false when the user clicks cancel. This is easy to confirm via the Ruby Console. You can find examples in numerous plugins with code such as
unless (results)... # abort when cancel
if(results)... # proceed when not cancel
if(results == false)... # again, abort when cancel
The only one that won't work is results[], since false is not an Array.
-
RE: Pinwheel table
A Domino would make it easier to cut the mortises in the ends of the rails, though you'd have to be careful to get the fence flat against the end of the curved rail. However, you'd have to get creative to cut the ones in the round center post. The flat there is not wide enough to register the fence of the domino. A couple of ideas occur to me:
- You could initially make the post triangular cross section and mill the slots extra deep, then turn it to final size.
- You could make a jig that would sit on the flat but span wider than the rail and again mill the slot through it extra deep.
Steve
-
RE: Compound angle Tool
@dave r said:
Thanks Steve. I'll give it a whirl.
You're welcome. Please note that I didn't provide explicit output of the slanted leg length as it can easily be measured using the Tape Measure Tool.
Steve
-
RE: Compound angle Tool
Version 0.2 implementing Dave's suggestion is now available on the sketchUcation plugins store.
Steve
-
RE: Compound angle Tool
Dave,
Thanks for the feedback! That should be an easy change. I'll look at it when I get home on Monday.
Steve
-
RE: Compound angle Tool
TIG beat me to the punch, and he is correct: so long as you don't try to install completely manually, there is nothing special about Mac vs Windows.
Steve
-
RE: Compound angle Tool
@davidheim1 said:
For Mac users like me, who don't download a lot from the PlugIn Store, could you post some instructions on how to install your plug-in?
Many thanks,
dhIf you install the Plugin Store Tool in your SketchUp, it will handle all the details for you automatically. There are instructions on sketchUcation on how to obtain the Plugin Store Tool. Then you just need to select the plugin (there is a search facility) and click "Autoinstall".
If you don't have or don't want to use the PS Tool, you can download directly from this link:
SketchUp Plugins | PluginStore | SketchUcation
SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins
(sketchucation.com)
Keep track of where the rake_and_splay.rbz file downloads to. Then run SketchUp and open SketchUp->Preferences->Extensions. At the bottom of the dialog there is button labeled "Install Extension...". Click this button and using the Finder-like UI, select the file you downloaded and click OK. The extension should be installed and available immediately.
Hope that helps
Steve