No pushpull when touching ????
-
You are quite right! Another stupid typo from my copy/paste I must take more care... I only have a few seconds allocated to answer each post [that's my excuse ]...
OR to be exact, the code could bekrvFlade = gents.add_face(gents.add_circle([0,0,0], [0,0,-1], diameter.to_f/2, 48))
because we've made a reference to
grp1
entities named 'gents
'At least you understand the concept behind what I was [trying to] show !
That is - make the connected geometry [all off it ] inside a group to avoid it interfering with layer creations that can be inside their own groups...PS: I'm not clear why you need to use
diameter.to_f/2
when making the circle, because you can [should] initially set/get/pass 'diameter
' as alength
so then there's no need to mess on with it later, since halving it as alength
will work without changing its class:? -
@tig said:
PS: I'm not clear why you need to use
diameter.to_f/2
when making the circle, because you can [should] initially set/get/pass 'diameter
' as alength
so then there's no need to mess on with it later, since halving it as alength
will work without changing its class:?I get a DIAMETER from the inputbox, but the circle method needs a RADIUS - that's why ...
but maybe I should call the argument 'radius' and make the calculation in the call instead.
-
NO, you miss my point.
I understand the input in the dialog is a 'diameter' BUT because it's already a 'length
' as you set it to say100.mm
initially you don't need to do the.to_f
step...
Dividing a 'length' by 2 is fine - it returns a new 'length' half as big. -
OK - now I can make those two parts of the pulley - the wheel and the cylinder - as two separate groups !
Now I want to drill a hole through BOTH of them for the shaft - but I can't because they are different groups !
I think I'll have to make a third group for the hole because of the pushpull won't work if the "beginning circle" is made on the buttom of the cylinder (like my problems makeing the cylinder under the pulley !) and that's making it all even worse !
It can't be true it is SO sofisticated to do such trivial things !
I thing I need a sample code for:
- making a hole in a cylinder for a shaft
- sort of moving all entities from one group X into another group Y - maybe as a sub-group in group Y or just "entities" in group Y
I cant find samples out there - do you have any links ?
-
Why not spend a few minutes to work out the cross-section of the pulley+axle+hole as a profile face... then do a FollowMme around [any] circle ?
That way it's all done in one go...
Sometime you need to break down what you are doing into separate steps, other times doing it all in one go proves to be the best...
Like you might do 'by hand', which will prove better than making all of the separate parts and combining them later... -
Of cause I do !
But then I DON'T find out - how to build up a group bit by bit and it could be nice too.
But I'll finish my pulley script with your idea !
-
If you want to build it up in parts you can.
I suggest you make a container group that holds all of the sub-groups.
Then when you explode sub-groups the geometry still stays inside the 'container'.
IF you have a reference to a face or can get a reference to it later [perhaps from face.classify_point()] then creating a circle on the face and pushpulling it through to the other side of the object [you know the 'thickness ?] is quite possible and should then leave the 'hole'...Why not do a simple 'practice' on a dead simple box with a smaller square drawn on it, that is then extruded through the box by exactly the box's thickness to leave a hole...
-
@tig said:
If you want to build it up in parts you can.
I suggest you make a container group that holds all of the sub-groups.
Then when you explode sub-groups the geometry still stays inside the 'container'.
IF you have a reference to a face or can get a reference to it later [perhaps from face.classify_point()] then creating a circle on the face and pushpulling it through to the other side of the object [you know the 'thickness ?] is quite possible and should then leave the 'hole'...Why not do a simple 'practice' on a dead simple box with a smaller square drawn on it, that is then extruded through the box by exactly the box's thickness to leave a hole...
Yeah,I'll give it a try - thx
-
@tig said:
PS: I'm not clear why you need to use
diameter.to_f/2
when making the circle, because you can [should] initially set/get/pass 'diameter
' ***** as alength
***** so then there's no need to mess on with it later, since halving it ***** as alength
***** will work without changing its class:?@TIG.. you're confusing him.
It's class
**Length**
... and the method to use isdiameter.to_l
.. so rephrase as:@unknownuser said:
PS: I'm not clear why you need to use
diameter.to_f/2
when making the circle, because you can [should] initially set/get/pass 'diameter
' as aLength
class object,
diameter = diameter.to_l
... so then there's no need to mess on with it later, since halving it as aLength
instance, will work without changing its class. (FYI:Length
is a subclass ofFloat
class.)@Keld: see the API's entry for the Length and Numeric classes.
-
No Dan... you need the 'back-story'... in his dialog the default value for diameter is already predetermined to be a 'length' [say 100.mm] - or it ought to be!
So any new value he types in stays a 'length' e.g. 150.mm
Therefore to find half of it to use as a radius he divides it by 2.
He does not need to convert the diameter into a 'float' [.to_f] OR to a 'length' [.to_l] or into anything else for that matter - it's already 'the right type' [a 'length'] and he can use it directly in his methods...
What I said stands. -
So does what I said.. the class name begins with a capital, as ALL class identifiers do.
HE was not understanding that you meant the Ruby
Length
class... he thought it was the plain old English word length. (Re-read his responce.)I know he doesn't need to use
.to_f
...
That's why at the end, I said that "FYI:Length
is a subclass ofFloat
class."But.. excuse for chiming in ... he's confused enuff already.. I will bow out. Sorry, if I got yur dander up, there TIG.
-
I did put it in Ruby
red
to stress it was somehow 'special' without going into the added confusion of 'classes' - with an example to explain it too...
OK it maybe ought to have a 'capital-letter', but we all sayfloat
not**F**loat
quite a lot too without much of an issue !
But no dander is up [yet]...
Advertisement