CAD Application

2019-05-06 Thread Britto .
Hello All,

What are the frameworks available for developing a CAD application with
Python?


Regards
Britto
-- 
https://mail.python.org/mailman/listinfo/python-list


How to create a boolean mask for the data arrays with uint16, int8 type?

2019-05-06 Thread blmadhavan
Hi,

How can I create a boolean mask for the data arrays with integer type? I want 
to create a 'useSample' boolean array for masking or discarding the unwanted 
data from the array.

[nr,nc] = np.shape(ftype)  # 
useSamples = np.full((nr,nc), True, dtype=bool)

I want to transform the following MATLAB code lines to create the masked array:

useSamples(ftype == 3 & subtype ~=2) = false
useSamples(cad > -70) = false
useSamples(extnQC < 0) = false

Finally, I want to extract X variable samples to exclude/ screen out what I 
don't want (MATLAB expression)

X_screened = X(useSamples)  

Can someone help me how I can transform the above MATLAB lines into Python code?

I have the following data arrays with types uint16 and int8. The 8 columns 
correspond to 8 layers. Number of layers observed is given by 'nlay' variable 
as shown below.

ftype = array([[1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [3, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [3, 1, 1, 1, 1, 1, 1, 1],
   [3, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [3, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [3, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1, 1, 1, 1]], dtype=uint16)

subtype = array([[0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [5, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [2, 0, 0, 0, 0, 0, 0, 0],
   [2, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [2, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [2, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0],
   [0, 0, 0, 0, 0, 0, 0, 0]], dtype=uint16)

cad = array([[-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [ -84, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [ -63, -127, -127, -127, -127, -127, -127, -127],
   [ -72, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [ -38, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127],
   [-127, -127, -127, -127, -127, -127, -127, -127]

Re: CAD Application

2019-05-06 Thread Gary Herron



On 5/5/19 10:23 PM, britt...@gmail.com wrote:

Hello All,

What are the frameworks available for developing a CAD application with
Python?


Regards
Britto


Well, there's PythonCadhttps://sourceforge.net/projects/pythoncad/

It seems to have stopped development about 5 years ago, but it's still 
available for download.



--
Dr. Gary Herron
Professor of Computer Science
DigiPen Institute of Technology
(425) 895-4418

--
https://mail.python.org/mailman/listinfo/python-list


Re: CAD Application

2019-05-06 Thread Christian Gollwitzer

Am 06.05.19 um 07:23 schrieb Britto .:

What are the frameworks available for developing a CAD application with
Python?


For 3D visualization VTK is your best bet. It can efficiently handle 
large data sets.


Christian
--
https://mail.python.org/mailman/listinfo/python-list


Using a Variable Inside the String

2019-05-06 Thread sveemani
Hi all,

I am new learner of python programming and I am into my basics.
I got  struck with the code in   a sample  program and refer the same with IDE 
and  googling which did not help me for more than a day.

What is  wrong with  my last 2  lines?
what I am missing?

##
my_name = 'Veera'
my_age = 40 #  Actually 42
my_height = 155 # Inches
my_weight = "80" # checking the double quotes
my_eyes = 'brown'
my_teeth = 'white'
my_hair =  'black'

print(f"Let's  talk  about  {my_name}.")
print(f"He's {my_height} inches  tall.")
print(f"He's {my_weight} weight heavy.")
print("Actually  thats  not too Heavy.")

print(f"He's  got {my_eyes} eyes and {my_hair}  hair.")
print(f"His  teeth are actually  {my_teeth} depending on the  coffee.")


### this  line are where I Struck #
total =   my_age + my_height + my_weight
print(f"If I add {my_age}, {my_height}, and {my_weight} I get  {total} .")

##
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using a Variable Inside the String

2019-05-06 Thread Chris Angelico
On Tue, May 7, 2019 at 4:50 AM  wrote:
>
> Hi all,
>
> I am new learner of python programming and I am into my basics.
> I got  struck with the code in   a sample  program and refer the same with 
> IDE and  googling which did not help me for more than a day.
>
> What is  wrong with  my last 2  lines?
> what I am missing?
>
> ##
> my_weight = "80" # checking the double quotes

What does this mean? Especially, what does the comment mean?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: CAD Application

2019-05-06 Thread Brian Oney via Python-list
FreeCAD is written in Python. It has a python interpreter.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using a Variable Inside the String

2019-05-06 Thread MRAB

On 2019-05-06 19:44, sveem...@gmail.com wrote:

Hi all,

I am new learner of python programming and I am into my basics.
I got  struck with the code in   a sample  program and refer the same with IDE 
and  googling which did not help me for more than a day.

What is  wrong with  my last 2  lines?
what I am missing?

##
my_name = 'Veera'
my_age = 40 #  Actually 42
my_height = 155 # Inches
my_weight = "80" # checking the double quotes
my_eyes = 'brown'
my_teeth = 'white'
my_hair =  'black'

print(f"Let's  talk  about  {my_name}.")
print(f"He's {my_height} inches  tall.")
print(f"He's {my_weight} weight heavy.")
print("Actually  thats  not too Heavy.")

print(f"He's  got {my_eyes} eyes and {my_hair}  hair.")
print(f"His  teeth are actually  {my_teeth} depending on the  coffee.")


### this  line are where I Struck #


'my_age' and 'my_height' are numbers, but 'my_weight' is a string 
(why?). You can't add a number and a string together.



total =   my_age + my_height + my_weight
print(f"If I add {my_age}, {my_height}, and {my_weight} I get  {total} .")

##


--
https://mail.python.org/mailman/listinfo/python-list