Show messages:
1-10
…
131-150
151-170
171-190
191-210
211-230
231-250
251-270
…
371-372
Message 8665.191 was deleted
From: Cemortan_Tudor
Hi Michael !
I think this should rise an error
createPoint(moi.vectorMath.add(obj.getStartPt(), scaleVector(obj.evaluateTangent(obj.domainMin), -1))).commit() - correct state
createPoint(moi.vectorMath.add(obj.getStartPt(), scaleVector(obj.evaluateTangent(obj.domainMin)),-1)).commit() - should rise -> it creates an null point
function scaleVector(v, factor) ... return moi.vectorMath.createPoint(x,y,z)
From: Cemortan_Tudor
Hi Michael !
I'm working a script & I wanna optimize it ! it uses a lot of moi.vectorMath.add()
wanna ask what's the math behind that function ? mb will improve runtime (not to call internals todo math operations )
From: Michael Gibson
Hi Tudor,
re:
> it uses a lot of moi.vectorMath.add()
> wanna ask what's the math behind that function ?
Like this:
var PtA, PtB, Result;
<......>
Result.x = PtA.x + PtB.x;
Result.y = PtA.y + PtB.y;
Result.z = PtA.z + PtB.z;
- Michael
From: Cemortan_Tudor
scripts for edge selection :
I wanted ~ growLoop similar to Subd, with v4 it became possible
works only for 1 selected object -> possible multiple edge selection
_GrowSelectionTangecy - expands only once
_ExpandSelectionTangecy - expands full selection
testing files are on moi_objects.rar
I haven't done more optimization since ~ 140ms is good result on big_object test (started from 20s -> 2s -> 1.2s-> 0.140)
quick Notes:
factory.Update() + getCreatedObjects() - it's slow process - better avoid it
looping same object - debugging -> might have different selection order - idk why it's happening - have to place into java object
Ps: why getEndPt() != domainMax ?
Attachments:
moi_objects.rar
_ExpandSelectionTangecy.js
_GrowSelectionTangecy.js
From: Cemortan_Tudor
add point
D -> delete corners
Attachments:
AddPoint.js
From: Cemortan_Tudor
http://moi3d.com/forum/index.php?webtag=MOI&msg=8665.136
Shortcuts for manipulation:
Fillet; Inset; Shell ; Offset(Brep)
Numpad+ -> value + value/2
Shift+Numpad+ -> value + value/10
Numpad- -> value - value /3
Shift+Numpad- -> value + value/10
Numpad* -> value*2
Numpad/ -> value/2
//added
small adjustments
Ctrl+Shift+Numpad+ -> value +value/100
Ctrl+Shift+Numpad- -> value - value/100
r - reset distance to 0 -> to start new one
Attachments:
GetDistance.js
From: Cemortan_Tudor
Hi Michael
for offset - through point, I wanna store value for next op - have the same as previous - how shall I do it ? (temporary global save*)
From: Cemortan_Tudor
magic of offset ~ weird behavior
Attachments:
buggy_offset.3dm
From: Cemortan_Tudor
I've tested in other software to see if it's rly a problem !
Rhino Fails - buggy
DesignSpark Mechanical - buggy
Illustrator - it doest care about continuity
Fusion 360 - it maxed the continuity- when it breaks, will round corners
Image Attachments:
23123.jpg
From: Michael Gibson
Hi Tudor,
re:
> for offset - through point, I wanna store value for next op - have the same as previous - how
> shall I do it ? (temporary global save*)
There's moi.command.setOption() and moi.command.getOption() that can be used for that.
The setOption works like: moi.command.setOption( 'string_id', val );
getOption goes like this:
var val = moi.command.getOption( 'string_id' );
One thing to watch out for is that getOption() will throw an exception if there isn't anything saved with that string id before, so you need to use it in a try/catch block like this:
var Val = 5;
try {
Val = moi.command.getOption( 'string_id' );
}
catch(e) {}
- Michael
From: Michael Gibson
Hi Tudor,
re:
> magic of offset ~ weird behavior
Offset has been tuned up quite a bit already for the next beta and it shouldn't make the weird excessive extensions anymore.
It will try to make a G2 continuous extension but it looks at how much the extension bends and once it is beyond a limit it switches to G1 line extensions:
- Michael
From: Cemortan_Tudor
thanks !
From: Cemortan_Tudor
rectangle round corner if forgot check button - applies instead of cancel entire op
Attachments:
GetRectRoundCorner.js
From: Cemortan_Tudor
for offset - here's a solution
if (pointpicker.event == 'finished') {
moi.command.setOption('OffsetCurveDistance', factory.getInput(1));
break;
}
if I'll need i can swap from thought point, to distance by hotkey or manual .. it will remember last input
offset factory input 1 = distance
but
moi.ui.alert(factory.getInput(1)) returns moi.object. Is a way to return value? or search for another way ?
From: Michael Gibson
Hi Tudor,
re:
> moi.ui.alert(factory.getInput(1)) returns moi.object. Is a way to return value? or search for another way ?
factory.getInput(index) returns a geometry factory input object which has a getValue() function on it.
- Michael
From: Cemortan_Tudor
sry but I have and error ..
it's making smt & I can't define where's the error
Image Attachments:
NewCanvas1.jpg
From: Michael Gibson
Hi Tudor, if the input has never been initialized with any value, it will throw an "operation failed" exception.
So you would need something like:
var gotvalue = false;
var value;
try {
value = input.getValue();
gotvalue = true;
} catch(e){}
- Michael
From: Cemortan_Tudor
nope
factory.getInput(1) - returns object
factory.getInput(1).getValue() - always undefined
my assumption is that
1. cuz it wasnt any init from js (factory.setValue(1)...) it cant read the values from factory
2. factory.getInput(1) - has a different object format
3. curveOffsetDistance internal is returning undefined after execution -> while dragging offset - the value is always 0
I give up
Image Attachments:
Screenshot_14.png
From: Michael Gibson
Hi Tudor, if you can post a complete script file that I can run over here I can take a look.
- Michael
Show messages:
1-10
…
131-150
151-170
171-190
191-210
211-230
231-250
251-270
…
371-372