FreeCAD Logo FreeCAD 1.0
  • Inglés Africano Árabe Bielorruso Catalán Checo Alemán Griego Español Español Euskera Finlandés Filipino Francés Gallego Croata Húngaro Indonesio Italiano Japonés Cabilio Coreano Lituano Neerlandés bokmal de Noruega Polaco Portugués Portugués Rumano Ruso Eslovaco Esloveno Serbio Sueco Turco Ucraniano Valenciano Vietnamita Chino Chino
  • Características
  • Descarga
  • Blog
  • Documentación
    Índice de documentación Primeros pasos Documentacion para el usuario El manual de FreeCAD Documentación de entornos de trabajo Documentación sobre FreeCAD + Python Documentación de codificación de C++ Tutoriales Preguntas frecuentes Política de privacidad Acerca de FreeCAD
  • Contribuir
    ¿Cómo puedo ayudar? Sponsor Informar de un error Hacer un pull request Trabajos y financiación Pautas de contribución Manual de desarrolladores Traducciones
  • Comunidad
    Código de conducta Foro The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendario
  • ♥ Donate

Donate

$
Información de SEPA
Configure su transferencia bancaria SEPA a:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Agencia bancaria: BNP Paribas Fortis
Dirección: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Vista de alineación de macro a cara

Descripción
Esta macro alinea la vista actual a una cara seleccionada

Versión macro : 1.0
Fecha última modificación : 2014-03-12
Versión FreeCAD : All
Descargar : ToolBar Icon
Autor : Rockn
Autor
Rockn
Descargar
ToolBar Icon
Enlace
Macros recipes
How to install macros
How to customize toolbars
Versión Macro
1.0
Fecha última modificación
2014-03-12
Versión(es) FreeCAD
All
Acceso directo predeterminado
None
Ver también
None

Descripción

Esta macro gira la vista actual para apuntar perpendicularmente a una cara seleccionada de un objeto existente.

Usage

Cómo usar

  1. Seleccionar una cara en un objeto
  2. Ejecutar la macro

Script

ToolBar Icon

Macro_Align_View_to_Face.FCMacro

# -*- coding: utf-8 -*-
# Set the current view perpendicular to the selected line
# Place la vue perpendiculairement a la line selectionnee
# 2013 Jonathan Wiedemann,
# 2016 Werner Mayer, 
# 2022 tchernomax, https://forum.freecad.org/viewtopic.php?p=630019#p630019
# 2023 FreeCutter, modifications towards linked objects like in workbench Assembly 4 , https://forum.freecad.org/viewtopic.php?p=718516#p718516
#
__title__   = "Align_View_to_Face"
__author__  = "Jonathan Wiedemann (Rockn)"
__url__     = "https://www.freecad.org"
__Wiki__    = "https://wiki.freecad.org/Macro_Align_View_to_Face"
__version__ = "3.1"
__date__    = "2023/11/12"  #YYYY/MM/DD

from pivy import coin

import FreeCAD as app
import FreeCADGui as gui

def pointAt(normal, up):
    z = normal
    y = up
    x = y.cross(z)
    y = z.cross(x)
   
    rot = App.Matrix()
    rot.A11 = x.x
    rot.A21 = x.y
    rot.A31 = x.z
   
    rot.A12 = y.x
    rot.A22 = y.y
    rot.A32 = y.z
   
    rot.A13 = z.x
    rot.A23 = z.y
    rot.A33 = z.z

    return App.Placement(rot).Rotation

def get_selection_and_turn_view():
	doc = app.activeDocument()
	if doc is None:
		app.Console.PrintWarning('Align_view_to_face: No file open, nothing to do\n')
		return
	
	selection = gui.Selection.getSelectionEx('', 0) # Returns a vector of selection objects
	
	if not selection:
		app.Console.PrintWarning('Align_view_to_face: Nothing selected, nothing to do\n')
		return
	
	cam = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
	
	''' used to understand the 'getSelection' results
	for selection_object in selection:
		object_ = selection_object.Object
		sub_fullpaths = selection_object.SubElementNames
		if not sub_fullpaths:
			# An object is selected, not a face, edge, vertex.
			print(object_.Name)
		for sub_fullpath in sub_fullpaths:
			# One or more subelements are selected.
			print(object_.Name, sub_fullpath)
	'''
	
	sel = selection[0]
	face = sel.SubObjects[0]
	if face.Area == 0:			# trying to avoid errors due to wrong selected objects
		app.Console.PrintWarning('Align_view_to_face: Please select a face - not an edge or vertex\n')
		return
	dir = face.normalAt(0,0)
	
	if dir.z == 1 :
	    rot = pointAt(dir, App.Vector(0.0,1.0,0.0))
	elif dir.z == -1 :
	    rot = pointAt(dir, App.Vector(0.0,1.0,0.0))
	else :
	    rot = pointAt(dir, App.Vector(0.0,0.0,1.0))
	
	cam.orientation.setValue(rot.Q)
	gui.SendMsgToActiveView("ViewSelection")
	app.Console.PrintWarning('Align_view_to_face: Done\n')

if __name__ == '__main__':
	get_selection_and_turn_view()

Esta página ha sido recuperada de https://wiki.freecad.org/Macro_Align_View_to_Face

¡Contáctanos!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© El equipo de FreeCAD. Créditos de imagen de la página principal (de arriba a abajo): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

Este proyecto es apoyado por: , KiCad Services Corp. y otros patrocinadores

GitHubMejora esta página en GitHub